From 0ac522fc4cc96c366fd8161bc7da130f438f453c Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Mon, 8 Dec 2014 13:18:06 +0000 Subject: [PATCH] Support for some (optional) feedback during uploads. SVN:trunk[3455] --- js/icon_select.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/js/icon_select.js b/js/icon_select.js index 72e87755c..413a403d2 100644 --- a/js/icon_select.js +++ b/js/icon_select.js @@ -34,7 +34,7 @@ $(function() } this.oImg = $(''); this.oLabel = $(''+sLabel+''); - this.oButton = $(''); + this.oButton = $(''); this.oButton.prepend(this.oLabel).prepend(this.oImg); this.oButton.click(function(event, ui) { me._on_button_clicked(event, ui); }); this.element.after(this.oButton); @@ -49,7 +49,7 @@ $(function() }); if (this.options.post_upload_to != null) { - this.oUploadBtn = $(''); + this.oUploadBtn = $(''); this.oUploadBtn.click( function() { me._upload_dlg(); } ); this.oButton.after(this.oUploadBtn); } @@ -193,6 +193,12 @@ $(function() _do_upload: function() { var me = this; + var $element = this.oUploadDlg.find('#file'); + this.oUploadDlg.closest('.ui-dialog').find('.ui-button').button('disable'); + if (ReplaceWithAnimation) + { + ReplaceWithAnimation($element); + } $.ajaxFileUpload ( { @@ -226,11 +232,12 @@ $(function() this.oLabel.text(this.options.items[idx].label); } this.element.trigger('change'); - this.oUploadDlg.dialog( "close" ); + this.oUploadDlg.dialog('close'); }, _on_upload_error: function(data, status, e) { alert(e); + this.oUploadDlg.closest('.ui-dialog').find('.ui-button').button('enable'); } }); });