diff options
Diffstat (limited to 'program/js')
-rw-r--r-- | program/js/app.js | 9 | ||||
-rw-r--r-- | program/js/list.js | 7 |
2 files changed, 10 insertions, 6 deletions
diff --git a/program/js/app.js b/program/js/app.js index 42cbaa6f9..55dea3620 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -3032,9 +3032,12 @@ function rcube_webmail() // test if purge command is allowed this.purge_mailbox_test = function() { - return (this.env.exists && (this.env.mailbox == this.env.trash_mailbox || this.env.mailbox == this.env.junk_mailbox - || this.env.mailbox.match('^' + RegExp.escape(this.env.trash_mailbox) + RegExp.escape(this.env.delimiter)) - || this.env.mailbox.match('^' + RegExp.escape(this.env.junk_mailbox) + RegExp.escape(this.env.delimiter)))); + return (this.env.exists && ( + this.env.mailbox == this.env.trash_mailbox + || this.env.mailbox == this.env.junk_mailbox + || this.env.mailbox.indexOf(this.env.trash_mailbox + this.env.delimiter) == 0 + || this.env.mailbox.indexOf(this.env.junk_mailbox + this.env.delimiter) == 0 + )); }; diff --git a/program/js/list.js b/program/js/list.js index a814c325c..46d9d2757 100644 --- a/program/js/list.js +++ b/program/js/list.js @@ -1245,14 +1245,15 @@ scrollto: function(id) scroll_to = Number(row.offsetTop); } - if(this.fixed_header) + if (this.fixed_header) head_offset = Number(this.thead.offsetHeight); - + // if row is above the frame (or behind header) if (scroll_to < Number(this.frame.scrollTop) + head_offset) { // scroll window so that row isn't behind header this.frame.scrollTop = scroll_to - head_offset; - } else if (scroll_to + Number(row.offsetHeight) > Number(this.frame.scrollTop) + Number(this.frame.offsetHeight)) + } + else if (scroll_to + Number(row.offsetHeight) > Number(this.frame.scrollTop) + Number(this.frame.offsetHeight)) this.frame.scrollTop = (scroll_to + Number(row.offsetHeight)) - Number(this.frame.offsetHeight); } }, |