diff --git a/js/imce.js b/js/imce.js index 2e97b4a..c35160a 100644 --- a/js/imce.js +++ b/js/imce.js @@ -395,7 +395,8 @@ complete: function () { $(imce.tree[dir].li).removeClass('loading'); imce.vars.navbusy = null; - } + }, + error: imce.ajaxError }; }, @@ -439,7 +440,13 @@ //settings for upload uploadSettings: function () { - return {beforeSubmit: imce.uploadValidate, success: function (response) {imce.processResponse($.parseJSON(response));}, complete: function () {imce.fopLoading('upload', false);}, resetForm: true}; + return { + beforeSubmit: imce.uploadValidate, + success: function (response) {imce.processResponse($.parseJSON(response));}, + complete: function () {imce.fopLoading('upload', false);}, + resetForm: true, + error: imce.ajaxError, + }; }, //validate default ops(delete, thumb, resize) @@ -486,7 +493,15 @@ //settings for default file operations fopSettings: function (fop) { - return {url: imce.ajaxURL(fop), type: 'POST', dataType: 'json', success: imce.processResponse, complete: function (response) {imce.fopLoading(fop, false);}, data: imce.vars.opform +'&filenames='+ escape(imce.serialNames()) +'&jsop='+ fop + (imce.ops[fop].div ? '&'+ $('input, select, textarea', imce.ops[fop].div).serialize() : '')}; + return { + url: imce.ajaxURL(fop), + type: 'POST', + dataType: 'json', + success: imce.processResponse, + complete: function (response) {imce.fopLoading(fop, false);}, + data: imce.vars.opform +'&filenames='+ escape(imce.serialNames()) +'&jsop='+ fop + (imce.ops[fop].div ? '&'+ $('input, select, textarea', imce.ops[fop].div).serialize() : ''), + error: imce.ajaxError + }; }, //toggle loading state @@ -801,6 +816,6 @@ }; //initiate -$(document).ready(imce.initiate).ajaxError(imce.ajaxError); +$(document).ready(imce.initiate); })(jQuery); \ No newline at end of file