Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #5602 (closed enhancement: untested)

Opened 2 years ago

Last modified 2 years ago

[PATCH] In-Place-Editor missing onSuccess callback

Reported by: tagomoris@intellilink.co.jp Assigned to: thomas@fesch.at
Priority: high Milestone:
Component: script.aculo.us Version:
Severity: normal Keywords:
Cc:

Description

In-Place-Editor has 2 callbacks, onComplete/onFailure.

But callback on 'success' only doesn't exist, even if Ajax.Request/Ajax.Updater have it (as 'onSuccess').

I need it at to clear error-display-block.

Following patch makes Ajax.InPlaceEditor to pass through 'onSuccess' option's value to Ajax.Request/Ajax.Updater.

@@ -470,6 +470,8 @@
       onComplete: function(transport, element) {
         new Effect.Highlight(element, {startcolor: this.options.highlightcolor});
       },
+      onSuccess: function(transport) {
+      },
       onFailure: function(transport) {
         alert("Error communicating with the server: " + transport.responseText.stripTags());
       },
@@ -642,6 +644,9 @@
     this.leaveEditMode();
     return false;
   },
+  onSuccess: function(transport) {
+    this.options.onSuccess(transport);
+  },
   onFailure: function(transport) {
     this.options.onFailure(transport);
     if (this.oldInnerHTML) {
@@ -665,6 +670,7 @@
         this.url, Object.extend({
           parameters: this.options.callback(form, value),
           onComplete: this.onComplete.bind(this),
+          onSuccess: this.onSuccess.bind(this),
           onFailure: this.onFailure.bind(this),
           asynchronous:true,
           evalScripts:true
@@ -677,6 +683,7 @@
         this.url, Object.extend({
           parameters: this.options.callback(form, value),
           onComplete: this.onComplete.bind(this),
+          onSuccess: this.onSuccess.bind(this),
           onFailure: this.onFailure.bind(this)
         }, this.options.ajaxOptions));
     }

Change History

09/03/06 18:11:28 changed by madrobby

  • status changed from new to closed.
  • resolution set to untested.