diff options
Diffstat (limited to 'program/js')
-rw-r--r-- | program/js/app.js | 15 | ||||
-rw-r--r-- | program/js/list.js | 3 | ||||
-rw-r--r-- | program/js/treelist.js | 12 |
3 files changed, 25 insertions, 5 deletions
diff --git a/program/js/app.js b/program/js/app.js index a8e66e211..e5a70c9f1 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -563,6 +563,7 @@ function rcube_webmail() this.treelist = new rcube_treelist_widget(this.gui_objects.folderlist, { selectable: true, id_prefix: 'rcmli', + parent_focus: true, id_encode: this.html_identifier_encode, id_decode: this.html_identifier_decode, check_droptarget: function(node) { return !node.virtual && ref.check_droptarget(node.id) } @@ -3361,7 +3362,8 @@ function rcube_webmail() } // check for locally stored compose data - this.compose_restore_dialog(0, html_mode) + if (this.env.save_localstorage) + this.compose_restore_dialog(0, html_mode) if (input_to.val() == '') input_to.focus(); @@ -3793,7 +3795,7 @@ function rcube_webmail() } // save compose form content to local storage every 5 seconds - if (!this.local_save_timer && window.localStorage) { + if (!this.local_save_timer && window.localStorage && this.env.save_localstorage) { // track typing activity and only save on changes this.compose_type_activity = this.compose_type_activity_last = 0; $(document).bind('keypress', function(e){ ref.compose_type_activity++; }); @@ -3849,6 +3851,10 @@ function rcube_webmail() // store the contents of the compose form to localstorage this.save_compose_form_local = function() { + // feature is disabled + if (!this.env.save_localstorage) + return; + var formdata = { session:this.env.session_id, changed:new Date().getTime() }, ed, empty = true; @@ -4439,7 +4445,7 @@ function rcube_webmail() this.ksearch_destroy(); // insert all members of a group - if (typeof this.env.contacts[id] === 'object' && this.env.contacts[id].type == 'group') { + if (typeof this.env.contacts[id] === 'object' && this.env.contacts[id].type == 'group' && !this.env.contacts[id].email) { insert += this.env.contacts[id].name + this.env.recipients_delimiter; this.group2expand[this.env.contacts[id].id] = $.extend({ input: this.ksearch_input }, this.env.contacts[id]); this.http_request('mail/group-expand', {_source: this.env.contacts[id].source, _gid: this.env.contacts[id].id}, false); @@ -4583,7 +4589,7 @@ function rcube_webmail() id = i + this.env.contacts.length; $('<li>').attr('id', 'rcmkSearchItem' + id) .attr('role', 'option') - .html(this.quote_html(text.replace(new RegExp('('+RegExp.escape(value)+')', 'ig'), '##$1%%')).replace(/##([^%]+)%%/g, '<b>$1</b>')) + .html('<i class="icon"></i>' + this.quote_html(text.replace(new RegExp('('+RegExp.escape(value)+')', 'ig'), '##$1%%')).replace(/##([^%]+)%%/g, '<b>$1</b>')) .addClass(type || '') .appendTo(ul) .mouseover(function() { ref.ksearch_select(this); }) @@ -5746,6 +5752,7 @@ function rcube_webmail() this.subscription_list = new rcube_treelist_widget(this.gui_objects.subscriptionlist, { selectable: true, tabexit: false, + parent_focus: true, id_prefix: 'rcmli', id_encode: this.html_identifier_encode, id_decode: this.html_identifier_decode, diff --git a/program/js/list.js b/program/js/list.js index 65e09e878..7e84ef2ae 100644 --- a/program/js/list.js +++ b/program/js/list.js @@ -1417,7 +1417,8 @@ use_arrow_key: function(keyCode, mod_key) */ scrollto: function(id) { - var row = this.rows[id].obj; + var row = this.rows[id] ? this.rows[id].obj : null; + if (row && this.frame) { var scroll_to = Number(row.offsetTop), head_offset = 0; diff --git a/program/js/treelist.js b/program/js/treelist.js index 3a1360229..a7cd7cd43 100644 --- a/program/js/treelist.js +++ b/program/js/treelist.js @@ -47,6 +47,7 @@ function rcube_treelist_widget(node, p) save_state: false, keyboard: true, tabexit: true, + parent_focus: false, check_droptarget: function(node) { return !node.virtual; } }, p || {}); @@ -187,6 +188,17 @@ function rcube_treelist_widget(node, p) $(document.body) .bind('keydown', keypress); + // catch focus when clicking the list container area + if (p.parent_focus) { + container.parent(':not(body)').click(function(e) { + if (!has_focus && selection) { + $(get_item(selection)).find(':focusable').first().focus(); + } + else if (!has_focus) { + container.children('li:has(:focusable)').first().find(':focusable').first().focus(); + } + }); + } /////// private methods |