diff options
author | Aleksander Machniak <alec@alec.pl> | 2015-01-23 16:58:29 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2015-01-23 16:58:29 +0100 |
commit | 64ed17594479d06e8fb67cc4740f0610885dc3f5 (patch) | |
tree | 3b783464e49cbdf1882a7f210cca23e531e1d2cf /skins | |
parent | b79a6e1b33aa47a93b45200997fd4514a887ea40 (diff) |
Code style improvements and fixes
Diffstat (limited to 'skins')
-rw-r--r-- | skins/larry/ui.js | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/skins/larry/ui.js b/skins/larry/ui.js index c07ec9989..839d787d6 100644 --- a/skins/larry/ui.js +++ b/skins/larry/ui.js @@ -277,21 +277,22 @@ function rcube_mail_ui() orientation:'v', relative:true, start:266, min:180, size:12 }).init(); } else if (rcmail.env.action == 'edit-prefs') { - $('<a href="#toggle"></a>') + var legend = $('#preferences-details fieldset.advanced legend'), + toggle = $('<a href="#toggle"></a>') .text(env.toggleoptions) .attr('title', env.toggleoptions) - .addClass('advanced-toggle') - .appendTo('#preferences-details fieldset.advanced legend'); - - $('#preferences-details fieldset.advanced legend').click(function(e){ - var collapsed = $(this).hasClass('collapsed'), - toggle = $('.advanced-toggle', this).html(collapsed ? '▲' : '▼'); - $(this) - .toggleClass('collapsed') - .closest('fieldset').children('.propform').toggle() - }).addClass('collapsed') - // this magically fixes incorrect position of toggle link created above in Firefox 3.6 - .parents('form').css('display', 'inline'); + .addClass('advanced-toggle'); + + legend.click(function(e) { + toggle.html($(this).hasClass('collapsed') ? '▲' : '▼'); + + $(this).toggleClass('collapsed') + .closest('fieldset').children('.propform').toggle() + }).append(toggle).addClass('collapsed') + + // this magically fixes incorrect position of toggle link created above in Firefox 3.6 + if (bw.mz) + legend.parents('form').css('display', 'inline'); } } /*** addressbook task ***/ |