summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-12-18 13:13:07 +0100
committerThomas Bruederli <bruederli@kolabsys.com>2014-12-18 13:13:07 +0100
commitceee7eb110df884155af024f3b2b7eebb8dd3378 (patch)
tree0643ba4a48ac8035c72abe6f719579b8bf40ee43
parentda0d0aca2ab098382237e0ea6f04b37d97129f87 (diff)
Prevent folder selection changes if app is busy (#1490158)
-rw-r--r--program/js/app.js1
-rw-r--r--program/js/treelist.js5
2 files changed, 6 insertions, 0 deletions
diff --git a/program/js/app.js b/program/js/app.js
index e92078961..3d714b92b 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -574,6 +574,7 @@ function rcube_webmail()
this.treelist
.addEventListener('collapse', function(node) { ref.folder_collapsed(node) })
.addEventListener('expand', function(node) { ref.folder_collapsed(node) })
+ .addEventListener('beforeselect', function(node) { return !ref.busy; })
.addEventListener('select', function(node) { ref.triggerEvent('selectfolder', { folder:node.id, prefix:'rcmli' }) });
}
diff --git a/program/js/treelist.js b/program/js/treelist.js
index 08e0e686d..6f7bfbef7 100644
--- a/program/js/treelist.js
+++ b/program/js/treelist.js
@@ -248,6 +248,11 @@ function rcube_treelist_widget(node, p)
*/
function select(id)
{
+ // allow subscribes to prevent selection change
+ if (me.triggerEvent('beforeselect', indexbyid[id]) === false) {
+ return;
+ }
+
if (selection) {
id2dom(selection, true).removeClass('selected').removeAttr('aria-selected');
if (search_active)