diff --git a/addons/web_editor/static/lib/jabberwock/jabberwock.css b/addons/web_editor/static/lib/jabberwock/jabberwock.css index cccaca857f9..5349495296e 100644 --- a/addons/web_editor/static/lib/jabberwock/jabberwock.css +++ b/addons/web_editor/static/lib/jabberwock/jabberwock.css @@ -1,78 +1,3 @@ -jw-editor { - display: flex; - flex-direction: column; - position: relative; -} -jw-editor { - display: flex; - flex-direction: column; -} - -.jw-dropdown { - display: inline-block; -} -.jw-dropdown .dropdown-menu { - min-width: 250px; - border: 1px solid #000; - background-color: #141217; -} - -jw-toolbar input { - color: #C6C6C6; -} -jw-resizer{ - display: block; - height: 7px; - background-color: #eee; - border-top: 1px solid #999; - text-align: center; - width: 100%; - line-height: 6px; - position: absolute; - bottom: 0; - cursor: row-resize; -} - -jw-resizer::before { - content: "☰"; - font-size: 6px; - margin-top: 1px; - display: inline-block; - transform: scale(5,1); - color: black; - vertical-align: middle; -} -table.table-picker { - position: absolute; - background-color: white; - border: 1px solid black; - -webkit-box-shadow: 2px 2px 5px 0px rgba(0,0,0,.4); - -moz-box-shadow: 2px 2px 5px 0px rgba(0,0,0,.4); - box-shadow: 2px 2px 5px 0px rgba(0,0,0,.4); -} -table.table-picker tr { - height: 1em; - padding: 0; -} -table.table-picker td { - width: 1em; - border: 1px solid black; - padding: 0; -} -table.table-picker td.highlight { - background-color: #875A7B; -} -#jw-device-preview { - border-width: 80px 14px 40px; - border-radius: 16px; - border-style: solid; - border-color: #000; - background-color: white; - width: 400px; - height: 700px; - margin: auto; - display: block; -} ul.checklist > li { list-style: none; position: relative; @@ -101,6 +26,28 @@ ul.checklist > li.checked:after { transition: opacity .5s; opacity: 1; } + +table.table-picker { + position: absolute; + background-color: white; + border: 1px solid black; + -webkit-box-shadow: 2px 2px 5px 0px rgba(0,0,0,.4); + -moz-box-shadow: 2px 2px 5px 0px rgba(0,0,0,.4); + box-shadow: 2px 2px 5px 0px rgba(0,0,0,.4); +} +table.table-picker tr { + height: 1em; + padding: 0; +} +table.table-picker td { + width: 1em; + border: 1px solid black; + padding: 0; +} +table.table-picker td.highlight { + background-color: #875A7B; +} + jw-dialog-container { position: fixed; top: 0; @@ -145,9 +92,17 @@ jw-dialog-container jw-dialog table.form-table { jw-dialog-container jw-dialog table.form-table td { border: none; } + jw-follow-range { position: absolute; } + +jw-editor { + display: flex; + flex-direction: column; + position: relative; +} + .jw-fullscreen .jw-fullscreen { display: block; position: fixed; @@ -164,6 +119,37 @@ jw-follow-range { .jw-fullscreen jw-follow-range { z-index: 1; } + +jw-editor { + display: flex; + flex-direction: column; +} + +.jw-dropdown { + display: inline-block; +} +.jw-dropdown .dropdown-menu { + min-width: 250px; + border: 1px solid #000; + background-color: #141217; +} + +jw-toolbar input { + color: #C6C6C6; +} + +#jw-device-preview { + border-width: 80px 14px 40px; + border-radius: 16px; + border-style: solid; + border-color: #000; + background-color: white; + width: 400px; + height: 700px; + margin: auto; + display: block; +} + jw-group[name="templates"] .label { width: 90px; } @@ -219,3 +205,26 @@ jw-templates jw-template:hover jw-thumb { jw-templates jw-template img { width: 100%; } + +jw-resizer{ + display: block; + height: 7px; + background-color: #eee; + border-top: 1px solid #999; + text-align: center; + width: 100%; + line-height: 6px; + position: absolute; + bottom: 0; + cursor: row-resize; +} + +jw-resizer::before { + content: "☰"; + font-size: 6px; + margin-top: 1px; + display: inline-block; + transform: scale(5,1); + color: black; + vertical-align: middle; +} diff --git a/addons/web_editor/static/lib/jabberwock/jabberwock.js b/addons/web_editor/static/lib/jabberwock/jabberwock.js index 630dc005b0a..0f0cdc85648 100644 --- a/addons/web_editor/static/lib/jabberwock/jabberwock.js +++ b/addons/web_editor/static/lib/jabberwock/jabberwock.js @@ -7141,7 +7141,7 @@ odoo.define('web_editor.jabberwock', (function(require) { if (parent) { const markers = []; parent.childVNodes.forEach(sibling => { - // Filter and sort the ndoes. + // Filter and sort the nodes. if (setNodes.has(sibling)) { if (sibling.tangible) { renderingUnits.push(this._createUnit(cache, sibling, rendered)); @@ -8336,12 +8336,42 @@ odoo.define('web_editor.jabberwock', (function(require) { function _isAtSegmentBreak(node, side) { const siblingSide = side === 'start' ? 'previousSibling' : 'nextSibling'; const sibling = node && node[siblingSide]; - const isAgainstAnotherSegment = sibling && _isSegment(sibling); + const isAgainstAnotherSegment = _isAgainstAnotherSegment(node, side); const isAtEdgeOfOwnSegment = _isBlockEdge(node, side); // In the DOM, a space before a BR is rendered but a space after a BR isn't. const isBeforeBR = side === 'end' && sibling && nodeName(sibling) === 'BR'; return (isAgainstAnotherSegment && !isBeforeBR) || isAtEdgeOfOwnSegment; } + /** + * Return true if the given node is just before or just after another segment. + * Eg: