summaryrefslogtreecommitdiff
path: root/plugins/kolab_notes
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-04-10 10:04:22 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2014-04-10 10:04:22 (GMT)
commit3bcd4637a6e6d176e2ecb43df0964de2074e9cf4 (patch)
treeaf331b913d9ae2a03dd8b8d305fc5a6beb261b27 /plugins/kolab_notes
parent590655758e7b4409eafc8b22d8dd4ebf9ef05128 (diff)
downloadroundcubemail-plugins-kolab-3bcd4637a6e6d176e2ecb43df0964de2074e9cf4.tar.gz
Open list edit dialog on dbl-clicks
Diffstat (limited to 'plugins/kolab_notes')
-rw-r--r--plugins/kolab_notes/notes.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/plugins/kolab_notes/notes.js b/plugins/kolab_notes/notes.js
index dc6d7d5..ef8262c 100644
--- a/plugins/kolab_notes/notes.js
+++ b/plugins/kolab_notes/notes.js
@@ -106,6 +106,26 @@ function rcube_kolab_notes_ui(settings)
}
});
+ // register dbl-click handler to open list edit dialog
+ $(rcmail.gui_objects.notebooks).on('dblclick', 'li:not(.virtual)', function(e){
+ var id = String(this.id).replace(/^rcmliknb/, '');
+ if (me.notebooks[id] && me.notebooks[id].editable) {
+ list_edit_dialog(id);
+ }
+
+ // clear text selection (from dbl-clicking)
+ var sel = window.getSelection ? window.getSelection() : document.selection;
+ if (sel && sel.removeAllRanges) {
+ sel.removeAllRanges();
+ }
+ else if (sel && sel.empty) {
+ sel.empty();
+ }
+
+ e.preventDefault();
+ return false;
+ });
+
// initialize notes list widget
if (rcmail.gui_objects.noteslist) {
noteslist = new rcube_list_widget(rcmail.gui_objects.noteslist,