diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 39c888ac1..8c5097a01 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1340,6 +1340,7 @@ define([ text: text }; }; + let toolbarVisibleOnSmallScreen = false; UIElements.createMarkdownToolbarToggle = function(toolbarElement, editor) { var $button = $(h('button', { @@ -1364,6 +1365,7 @@ define([ $button .attr('title', newLabel) .attr('aria-label', newLabel); + toolbarVisibleOnSmallScreen = !isExpanded; }); $(toolbarElement).on('keydown', function (e) { @@ -1383,9 +1385,6 @@ define([ return window.innerHeight < 530 || window.innerWidth < 530; } - let toolbarVisibleOnSmallScreen = false; - let wasSmallScreen = isSmallScreenToolbar(); - UIElements.updateToolbarVisibility = function(markdownEditorWrapper, toolbar, editor) { let toggleButton = null; const isSmallScreen = isSmallScreenToolbar(); @@ -1408,7 +1407,6 @@ define([ $(markdownEditorWrapper).find('.cp-markdown-toggle-button').remove(); $(toolbar).show(); } - wasSmallScreen = isSmallScreen; return toggleButton; };