}
}
- c.setStyle({ cursor: 'wait' });
this.skip_spellcheck = false;
if (action == 'addAttachment') {
// Use an AJAX submit here so that we can do javascript-y stuff
// before having to close the window on success.
- DimpCore.doAction(action, c.serialize(true), { callback: this.uniqueSubmitCallback.bind(this) });
+ DimpCore.doAction(action, c.serialize(true), {
+ ajaxopts: {
+ onFailure: this.uniqueSubmitFailure.bind(this)
+ },
+ callback: this.uniqueSubmitCallback.bind(this)
+ });
// Can't disable until we send the message - or else nothing
// will get POST'ed.
}
this.setDisabled(false);
+ },
- $((d.action == 'redirectMessage') ? 'redirect' : 'compose').setStyle({ cursor: null });
+ uniqueSubmitFailure: function(t, o)
+ {
+ if (this.disabled) {
+ this.setDisabled(false);
+ DimpCore.doActionOpts.onFailure(t, o);
+ }
},
setDisabled: function(disable)
{
+ var redirect = $('redirect');
+
this.disabled = disable;
- if ($('redirect').visible()) {
+ if (redirect.visible()) {
DimpCore.loadingImg('sendingImg', 'redirect', disable);
- DimpCore.toggleButtons($('redirect').select('DIV.dimpActions A'), disable);
+ DimpCore.toggleButtons(redirect.select('DIV.dimpActions A'), disable);
+ redirect.setStyle({ cursor: disable ? null : 'wait' });
} else {
DimpCore.loadingImg('sendingImg', 'composeMessageParent', disable);
DimpCore.toggleButtons($('compose').select('DIV.dimpActions A'), disable);
if (IMP_Compose_Base.editor_on) {
this.RTELoading(disable ? 'show' : 'hide', true);
}
+
+ $('compose').setStyle({ cursor: disable ? null : 'wait' });
}
},
doActionOpts: {
onException: function(r, e) { DimpCore.debug('onException', e); },
- onFailure: function(t, o) { DimpCore.debug('onFailure', t); },
+ onFailure: function(t, o) {
+ DimpCore.debug('onFailure', t);
+ DimpCore.showNotifications([ { type: 'horde.error', message: DIMP.text.ajax_error } ]);
+ },
evalJS: false,
evalJSON: true
},