From 64ed17594479d06e8fb67cc4740f0610885dc3f5 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 23 Jan 2015 16:58:29 +0100 Subject: [PATCH] Code style improvements and fixes --- skins/larry/ui.js | 27 ++++++++++++++------------- 1 file 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') { - $('') + var legend = $('#preferences-details fieldset.advanced legend'), + toggle = $('') .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 ***/