diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-06-20 13:39:46 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-06-20 13:39:46 +0200 |
commit | 763d9ded1d47612bab6423646c18a214473a72ae (patch) | |
tree | 53e38dd2e9652cefe042e77b3c1004a30146a619 /core/js/oc-dialogs.js | |
parent | ca96b9d3d5197da9d2686c8fe8e0cdcc2fbfa800 (diff) | |
download | nextcloud-server-763d9ded1d47612bab6423646c18a214473a72ae.tar.gz nextcloud-server-763d9ded1d47612bab6423646c18a214473a72ae.zip |
Prevent showing the file picker twice
In case the filepicker function is called twice, only show it once.
Diffstat (limited to 'core/js/oc-dialogs.js')
-rw-r--r-- | core/js/oc-dialogs.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index 0e4c346e8cc..a76f9170dc8 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -144,7 +144,13 @@ var OCdialogs = { */ filepicker:function(title, callback, multiselect, mimetypeFilter, modal) { var self = this; + // avoid opening the picker twice + if (this.filepicker.loading) { + return; + } + this.filepicker.loading = true; $.when(this._getFilePickerTemplate()).then(function($tmpl) { + self.filepicker.loading = false; var dialogName = 'oc-dialog-filepicker-content'; if(self.$filePicker) { self.$filePicker.ocdialog('close'); @@ -220,6 +226,7 @@ var OCdialogs = { .fail(function(status, error) { // If the method is called while navigating away // from the page, it is probably not needed ;) + self.filepicker.loading = false; if(status !== 0) { alert(t('core', 'Error loading file picker template: {error}', {error: error})); } |