diff options
author | thomascube <thomas@roundcube.net> | 2012-02-01 07:40:30 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2012-02-01 07:40:30 +0000 |
commit | a4e71c5c389336852bcca8bc729f67f5ce13cdd0 (patch) | |
tree | 7de7a51772c1e2247d0c89978f1f0d90e68f05d6 /skins/larry | |
parent | 6835114c4d0746f1c8ce7e28e6fc020c6ce4f739 (diff) |
Improve tabs and splitter functionality
Diffstat (limited to 'skins/larry')
-rw-r--r-- | skins/larry/ui.js | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/skins/larry/ui.js b/skins/larry/ui.js index d69e7faf9..1b03166c4 100644 --- a/skins/larry/ui.js +++ b/skins/larry/ui.js @@ -712,8 +712,8 @@ function rcube_mail_ui() */ function init_tabs(elem, current) { - var id = elem.id, - content = $(elem), + var content = $(elem), + id = content.get(0).id, fs = content.children('fieldset'); if (!fs.length) @@ -721,7 +721,7 @@ function rcube_mail_ui() if (!id) { id = 'rcmtabcontainer'; - elem.attr('id', id); + content.attr('id', id); } // first hide not selected tabs @@ -798,7 +798,7 @@ function rcube_mail_ui() /** - * Roundcube splitter GUI class + * Roundcube UI splitter class * * @constructor */ @@ -823,6 +823,10 @@ function rcube_splitter(p) this.p1 = $(this.p.p1); this.p2 = $(this.p.p2); + // check if referenced elements exist, otherwise abort + if (!this.p1.length || !this.p2.length) + return; + // create and position the handle for this splitter this.p1pos = this.relative ? this.p1.position() : this.p1.offset(); this.p2pos = this.relative ? this.p2.position() : this.p2.offset(); @@ -842,11 +846,9 @@ function rcube_splitter(p) this.handle.css({ left:left+'px', top:'0px' }); } - this.elm = this.handle.get(0); - // listen to window resize on IE if (bw.ie) - $(window).resize(function(e){ onResize(e) }); + $(window).resize(onResize); // read saved position from cookie var cookie = bw.get_cookie(this.id); |