diff --git a/customize.dist/src/less2/include/drive.less b/customize.dist/src/less2/include/drive.less index 7c428a3de..bf17b1e76 100644 --- a/customize.dist/src/less2/include/drive.less +++ b/customize.dist/src/less2/include/drive.less @@ -716,6 +716,9 @@ } } } + .cp-app-drive-element-state { + display: none !important; + } } } .cp-app-drive-element { @@ -729,6 +732,9 @@ .cp-app-drive-element-type, .cp-app-drive-element-filler { display: none !important; } + .cp-app-drive-element-sort { + display: block !important; + } } @media screen and (max-width: 740px) { @@ -744,9 +750,6 @@ .cp-app-drive-element-header .cp-app-drive-element-state { display: none !important; } - .cp-app-drive-element-sort { - display: block !important; - } } } diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 5d9f38077..868de93f4 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -2157,6 +2157,11 @@ define([ e.stopPropagation(); var state = $innerblock.is(':visible'); $('.cp-dropdown-content').hide(); + + var $c = $container.closest('.cp-toolbar-drawer-content'); + $c.removeClass('cp-dropdown-visible'); + if (!state) { $c.addClass('cp-dropdown-visible'); } + try { $('iframe').each(function (idx, ifrw) { $(ifrw).contents().find('.cp-dropdown-content').hide(); diff --git a/www/common/sframe-common-codemirror.js b/www/common/sframe-common-codemirror.js index 13655a333..42c5b6d9e 100644 --- a/www/common/sframe-common-codemirror.js +++ b/www/common/sframe-common-codemirror.js @@ -311,14 +311,7 @@ define([ common: Common }; var $block = exp.$language = UIElements.createDropdown(dropdownConfig); - $block.find('button').attr('title', Messages.languageButtonTitle).click(function () { - var state = $block.find('.cp-dropdown-content').is(':visible'); - var $c = $block.closest('.cp-toolbar-drawer-content'); - $c.removeClass('cp-dropdown-visible'); - if (!state) { - $c.addClass('cp-dropdown-visible'); - } - }); + $block.find('button').attr('title', Messages.languageButtonTitle); var isHovering = false; var $aLanguages = $block.find('a'); @@ -368,15 +361,7 @@ define([ common: Common }; var $block = exp.$theme = UIElements.createDropdown(dropdownConfig); - $block.find('button').attr('title', Messages.themeButtonTitle).click(function () { - // XXX copy-pasted code from configureLanguage. We can refactor this. - var state = $block.find('.cp-dropdown-content').is(':visible'); - var $c = $block.closest('.cp-toolbar-drawer-content'); - $c.removeClass('cp-dropdown-visible'); - if (!state) { - $c.addClass('cp-dropdown-visible'); - } - }); + $block.find('button').attr('title', Messages.themeButtonTitle); setTheme(lastTheme, $block);