summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web_editor/static/src/js')
-rw-r--r--addons/web_editor/static/src/js/editor/snippets.editor.js5
-rw-r--r--addons/web_editor/static/src/js/editor/summernote.js4
-rw-r--r--addons/web_editor/static/src/js/wysiwyg/wysiwyg_snippets.js10
3 files changed, 15 insertions, 4 deletions
diff --git a/addons/web_editor/static/src/js/editor/snippets.editor.js b/addons/web_editor/static/src/js/editor/snippets.editor.js
index 718c2407e57..e7d685262bc 100644
--- a/addons/web_editor/static/src/js/editor/snippets.editor.js
+++ b/addons/web_editor/static/src/js/editor/snippets.editor.js
@@ -888,6 +888,7 @@ var SnippetsMenu = Widget.extend({
this._notActivableElementsSelector = [
'#web_editor-top-edit',
+ '.o_we_website_top_actions',
'#oe_snippets',
'#oe_manipulators',
'.o_technical_modal',
@@ -926,6 +927,9 @@ var SnippetsMenu = Widget.extend({
this.customizePanel = document.createElement('div');
this.customizePanel.classList.add('o_we_customize_panel', 'd-none');
+ this.textEditorPanelEl = document.createElement('div');
+ this.textEditorPanelEl.classList.add('o_we_snippet_text_tools');
+
this.invisibleDOMPanelEl = document.createElement('div');
this.invisibleDOMPanelEl.classList.add('o_we_invisible_el_panel');
this.invisibleDOMPanelEl.appendChild(
@@ -1651,6 +1655,7 @@ var SnippetsMenu = Widget.extend({
// Add the computed template and make elements draggable
this.$el.html($html);
this.$el.append(this.customizePanel);
+ this.$el.append(this.textEditorPanelEl);
this.$el.append(this.invisibleDOMPanelEl);
this._makeSnippetDraggable(this.$snippets);
this._disableUndroppableSnippets();
diff --git a/addons/web_editor/static/src/js/editor/summernote.js b/addons/web_editor/static/src/js/editor/summernote.js
index 01269589811..f1145c8d8c1 100644
--- a/addons/web_editor/static/src/js/editor/summernote.js
+++ b/addons/web_editor/static/src/js/editor/summernote.js
@@ -984,12 +984,12 @@ renderer.tplButtonInfo.color = function (lang, options) {
value: '{"backColor":"#B35E9B"}'
});
var foreColorButton = renderer.getTemplate().button(foreColorButtonLabel, {
- className: 'note-fore-color-preview mx-1',
+ className: 'note-fore-color-preview',
title: lang.color.foreground,
dropdown: renderer.getTemplate().dropdown('<li><div data-event-name="foreColor" class="colorPalette"/></li>'),
});
var backColorButton = renderer.getTemplate().button(backColorButtonLabel, {
- className: 'note-back-color-preview mx-1',
+ className: 'note-back-color-preview',
title: lang.color.background,
dropdown: renderer.getTemplate().dropdown('<li><div data-event-name="backColor" class="colorPalette"/></li>'),
});
diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg_snippets.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg_snippets.js
index 9b4b9f84222..73801dc93f5 100644
--- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg_snippets.js
+++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg_snippets.js
@@ -36,11 +36,17 @@ Wysiwyg.include({
* @private
*/
_relocateEditorBar: function () {
+ if (!this.options.toolbarHandler.length) {
+ this.options.toolbarHandler = $('.o_we_snippet_text_tools');
+ }
this.options.toolbarHandler.append(this.editor.$el);
+
// TODO the next four lines are a huge hack: since the editor.$el
// is repositioned, the snippetsMenu elements are not at the
- // correct position anymore... the whole logic has to be refactored.
- if (this.editor.snippetsMenu) {
+ // correct position anymore if it was repositioned outside of it...
+ // the whole logic has to be refactored... hopefully not needed anymore
+ // with editor team changes
+ if (this.editor.snippetsMenu && !this.editor.snippetsMenu.$el.has(this.options.toolbarHandler).length) {
this.editor.snippetsMenu.$el.insertAfter(this.options.toolbarHandler);
this.editor.snippetsMenu.$snippetEditorArea.insertAfter(this.editor.snippetsMenu.$el);
}