From 8b04ced586931e1dd6b4759c2b972a01d877fe03 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Wed, 6 Aug 2025 14:33:47 +0200 Subject: [PATCH 1/1] fix edit buttons wrapping --- src/redakcja/static/css/html.scss | 1 + .../static/js/wiki/view_editor_wysiwyg.js | 31 +++++++++---------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/redakcja/static/css/html.scss b/src/redakcja/static/css/html.scss index 61d5a797..fb76fbbe 100644 --- a/src/redakcja/static/css/html.scss +++ b/src/redakcja/static/css/html.scss @@ -383,6 +383,7 @@ div[x-node] > .uwaga { background-color: #FAFAFA; border: 1px solid #DDD; border-bottom: none; + white-space: nowrap; &:hover { background-color: #999; diff --git a/src/redakcja/static/js/wiki/view_editor_wysiwyg.js b/src/redakcja/static/js/wiki/view_editor_wysiwyg.js index 219b405a..afd81082 100644 --- a/src/redakcja/static/js/wiki/view_editor_wysiwyg.js +++ b/src/redakcja/static/js/wiki/view_editor_wysiwyg.js @@ -441,7 +441,7 @@ } // start edition on this node - var $overlay = $('
').css({ + var $overlay = $('
').css({ position: 'absolute', height: h, left: x, @@ -572,23 +572,20 @@ var textAreaOpened = $('textarea', $overlay)[0]; var startTag = ""; var endTag = ""; - var buttonName = this.innerHTML; - - if(buttonName == "słowo obce") { - startTag = ""; - endTag = ""; - } else if (buttonName == "wyróżnienie") { - startTag = ""; - endTag = ""; - } else if (buttonName == "tytuł dzieła") { - startTag = ""; - endTag = ""; - } else if (buttonName == "znak spec."){ - addSymbol(); + var tag = ""; + var $this = $(this); + + if ($this.data('tag')) { + tag = $this.data('tag'); + startTag = "<" + $this.data('tag') + ">"; + endTag = ""; + } else if ($this.data('tag-selfclosing')){ + startTag = "<" + $this.data('tag-selfclosing') + "/>"; + } else if ($this.data('act')) { + if ($this.data('act') == 'spec') { + addSymbol(); + } return false; - } else if (buttonName == "br") { - startTag = "
"; - endTag = ""; } var myField = textAreaOpened; -- 2.20.1