diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-03-24 17:30:34 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-03-24 17:30:34 +0100 |
commit | 24e88e91f7ebac132fa356762b0cd544d42cef9f (patch) | |
tree | 3b99b6c2237fb26541a133f78405faffcddd5240 /skins/larry/ui.js | |
parent | a26c031621410f030751eae404490a10498583d7 (diff) | |
parent | 7889c57b772dbf722639894bd572c767424c8b84 (diff) |
Merge branch 'master' of github.com:roundcube/roundcubemail
Diffstat (limited to 'skins/larry/ui.js')
-rw-r--r-- | skins/larry/ui.js | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/skins/larry/ui.js b/skins/larry/ui.js index b787dbb8d..58e03fbdc 100644 --- a/skins/larry/ui.js +++ b/skins/larry/ui.js @@ -287,28 +287,36 @@ function rcube_mail_ui() /** * Update UI on window resize */ - function resize() + function resize(e) { - if (rcmail.env.task == 'mail') { - if (rcmail.env.action == 'show' || rcmail.env.action == 'preview') - layout_messageview(); - else if (rcmail.env.action == 'compose') - layout_composeview(); - } + // resize in intervals to prevent lags and double onresize calls in Chrome (#1489005) + var interval = e ? 10 : 0; - // make iframe footer buttons float if scrolling is active - $('body.iframe .footerleft').each(function(){ - var footer = $(this), - body = $(document.body), - floating = footer.hasClass('floating'), - overflow = body.outerHeight(true) > $(window).height(); - - if (overflow != floating) { - var action = overflow ? 'addClass' : 'removeClass'; - footer[action]('floating'); - body[action]('floatingbuttons'); + if (rcmail.resize_timeout) + window.clearTimeout(rcmail.resize_timeout); + + rcmail.resize_timeout = window.setTimeout(function() { + if (rcmail.env.task == 'mail') { + if (rcmail.env.action == 'show' || rcmail.env.action == 'preview') + layout_messageview(); + else if (rcmail.env.action == 'compose') + layout_composeview(); } - }); + + // make iframe footer buttons float if scrolling is active + $('body.iframe .footerleft').each(function(){ + var footer = $(this), + body = $(document.body), + floating = footer.hasClass('floating'), + overflow = body.outerHeight(true) > $(window).height(); + + if (overflow != floating) { + var action = overflow ? 'addClass' : 'removeClass'; + footer[action]('floating'); + body[action]('floatingbuttons'); + } + }); + }, interval); } /** |