diff options
author | Aleksander Machniak <alec@alec.pl> | 2014-06-05 15:54:25 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2014-06-05 15:54:25 +0200 |
commit | 64f7d6758fd269823ab19270a6ef5658f0a28669 (patch) | |
tree | 6bd1b62f503554c71caa5f6be2b27c2da158c144 | |
parent | 4f3f3b47e227408646392e7867ec21178a84ab3a (diff) |
Select/scroll to previously selected message when returning from message page (#1489023)
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | program/js/app.js | 24 | ||||
-rw-r--r-- | program/steps/mail/func.inc | 4 |
3 files changed, 25 insertions, 4 deletions
@@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Select/scroll to previously selected message when returning from message page (#1489023) - Display a warning if popup window was blocked (#1489618) - Remove (was: ...) from message subject on reply (#1489375) - Update to TinyMCE 4.0 (#1489057) diff --git a/program/js/app.js b/program/js/app.js index 6d66aa2c0..53eaa4aa8 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -2428,6 +2428,9 @@ function rcube_webmail() url._framed = 1; } + if (this.env.uid) + url._uid = this.env.uid; + // load message list to target frame/window if (mbox) { this.set_busy(true, 'loading'); @@ -7255,11 +7258,24 @@ function rcube_webmail() this.enable_command('expand-all', 'expand-unread', 'collapse-all', this.env.threading && this.env.messagecount && !is_multifolder); if ((response.action == 'list' || response.action == 'search') && this.message_list) { + var list = this.message_list, uid = this.env.list_uid; + + // highlight message row when we're back from message page + if (uid) { + if (!list.rows[uid]) + uid += '-' + this.env.mailbox; + if (list.rows[uid]) { + list.select(uid); + } + delete this.env.list_uid; + } + this.enable_command('set-listmode', this.env.threads && !is_multifolder); - if (this.message_list.rowcount > 0) - this.message_list.focus(); - this.msglist_select(this.message_list); - this.triggerEvent('listupdate', { folder:this.env.mailbox, rowcount:this.message_list.rowcount }); + if (list.rowcount > 0) + list.focus(); + this.msglist_select(list); + this.triggerEvent('listupdate', { folder:this.env.mailbox, rowcount:list.rowcount }); + } } else if (this.task == 'addressbook') { diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 0dba3c125..ac343ad5a 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -104,6 +104,10 @@ if (empty($RCMAIL->action) || $RCMAIL->action == 'list') { } } + if (!empty($_GET['_uid'])) { + $OUTPUT->set_env('list_uid', $_GET['_uid']); + } + // set configuration $RCMAIL->set_env_config(array('delete_junk', 'flag_for_deletion', 'read_when_deleted', 'skip_deleted', 'display_next', 'message_extwin', 'compose_extwin', 'forward_attachment')); |