Call resize() to fix floatingbuttons position in tabbed page (on tab selection)

pull/23/head
Aleksander Machniak 12 years ago
parent 10562d8a77
commit bbbacdc698

@ -254,11 +254,11 @@ function rcube_mail_ui()
*/ */
function resize() function resize()
{ {
if (rcmail.env.task == 'mail' && (rcmail.env.action == 'show' || rcmail.env.action == 'preview')) { if (rcmail.env.task == 'mail') {
layout_messageview(); if (rcmail.env.action == 'show' || rcmail.env.action == 'preview')
} layout_messageview();
if (rcmail.env.task == 'mail' && rcmail.env.action == 'compose') { else if (rcmail.env.action == 'compose')
layout_composeview(); layout_composeview();
} }
// make iframe footer buttons float if scrolling is active // make iframe footer buttons float if scrolling is active
@ -267,13 +267,13 @@ function rcube_mail_ui()
body = $(document.body), body = $(document.body),
floating = footer.hasClass('floating'), floating = footer.hasClass('floating'),
overflow = body.outerHeight(true) > $(window).height(); overflow = body.outerHeight(true) > $(window).height();
if (overflow != floating) { if (overflow != floating) {
var action = overflow ? 'addClass' : 'removeClass'; var action = overflow ? 'addClass' : 'removeClass';
footer[action]('floating'); footer[action]('floating');
body[action]('floatingbuttons'); body[action]('floatingbuttons');
} }
}) });
} }
/** /**
@ -847,6 +847,8 @@ function rcube_mail_ui()
// Select/unselect tab // Select/unselect tab
$('#tab'+idx).toggleClass('selected', idx==index); $('#tab'+idx).toggleClass('selected', idx==index);
}); });
resize();
} }
/** /**

Loading…
Cancel
Save