From ead09ca46c37b80a5e5d5ff98fe40cc502f8bbcb Mon Sep 17 00:00:00 2001 From: DianaXWiki Date: Wed, 4 Jun 2025 17:30:28 +0300 Subject: [PATCH] Keep state #1831 --- www/common/common-ui-elements.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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; };