From: Radek Czajka Date: Wed, 6 Aug 2025 12:33:47 +0000 (+0200) Subject: fix edit buttons wrapping X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/8b04ced586931e1dd6b4759c2b972a01d877fe03?ds=inline;hp=c0f614854cf883800a813cac3703fcc875b0b098 fix edit buttons wrapping --- 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;