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));
}