summaryrefslogtreecommitdiff
path: root/skins/larry/ui.js
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2012-12-29 16:24:39 +0100
committerThomas Bruederli <thomas@roundcube.net>2012-12-29 16:24:39 +0100
commit54241516d7e4e44520b9c4dea1bc82e078432018 (patch)
treecfa10322c93259a1c0636132f8a972f9370bf9b9 /skins/larry/ui.js
parent8809a1828477101ade03b261662df089e268ecb4 (diff)
Add toggle to minimize page header; automatically triggers on small screens
Diffstat (limited to 'skins/larry/ui.js')
-rw-r--r--skins/larry/ui.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/skins/larry/ui.js b/skins/larry/ui.js
index da4f2300e..d2faa3611 100644
--- a/skins/larry/ui.js
+++ b/skins/larry/ui.js
@@ -43,6 +43,15 @@ function rcube_mail_ui()
this.hide_header_row = hide_header_row;
+ // set minimal mode on small screens (don't wait for document.ready)
+ if (window.$ && document.body) {
+ var minmode = rcmail.get_cookie('minimalmode');
+ if (parseInt(minmode) || (minmode === null && $(window).height() < 850)) {
+ $(document.body).addClass('minimal');
+ }
+ }
+
+
/**
*
*/
@@ -59,6 +68,17 @@ function rcube_mail_ui()
{
rcmail.addEventListener('message', message_displayed);
+ /*** prepare minmode functions ***/
+ $('#taskbar a').each(function(i,elem){
+ $(elem).append('<span class="tooltip">' + $('.button-inner', this).html() + '</span>')
+ });
+
+ $('#taskbar .minmodetoggle').click(function(e){
+ var ismin = $(document.body).toggleClass('minimal').hasClass('minimal');
+ rcmail.set_cookie('minimalmode', ismin?1:0);
+ $(window).resize();
+ });
+
/*** mail task ***/
if (rcmail.env.task == 'mail') {
rcmail.addEventListener('menu-open', show_listoptions);