[IMP] web_editor: update odoo-editor lib to commit fb68d86

closes odoo/odoo#68687

Related: odoo/enterprise#17463
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
Antoine Guenet
2021-04-02 09:44:12 +00:00
parent 62261b6c9d
commit 5d8a8841a6
2 changed files with 25 additions and 6 deletions
@@ -159,6 +159,18 @@
.oe-toolbar #style .dropdown-menu {
text-align: left;
}
@media only screen and (max-width: 767px) {
.oe-toolbar {
position: relative;
visibility: visible;
width: 100%;
border-radius: 0;
background-color: white;
}
.oe-toolbar .btn {
color: black;
}
}
/* Content styling */
li.oe-nested {
@@ -2464,6 +2464,8 @@ var exportVariable = (function (exports) {
this.document = options.document || document;
this.isMobile = matchMedia('(max-width: 767px)').matches;
// Keyboard type detection, happens only at the first keydown event.
this.keyboardType = KEYBOARD_TYPES.UNKNOWN;
@@ -2561,6 +2563,9 @@ var exportVariable = (function (exports) {
this.updateColorpickerLabels();
});
}
if (this.isMobile) {
this.editable.before(this.toolbar);
}
}
}
/**
@@ -3819,11 +3824,13 @@ var exportVariable = (function (exports) {
if (!sel.anchorNode) {
show = false;
}
if (show !== undefined && this.options.autohideToolbar) {
this.toolbar.style.visibility = show ? 'visible' : 'hidden';
}
if (show === false && this.options.autohideToolbar) {
return;
if (this.options.autohideToolbar) {
if (show !== undefined && !this.isMobile) {
this.toolbar.style.visibility = show ? 'visible' : 'hidden';
}
if (show === false) {
return;
}
}
const paragraphDropdownButton = this.toolbar.querySelector('#paragraphDropdownButton');
for (const commandState of [
@@ -3897,7 +3904,7 @@ var exportVariable = (function (exports) {
undoButton && undoButton.classList.toggle('disabled', !this.historyCanUndo());
const redoButton = this.toolbar.querySelector('#redo');
redoButton && redoButton.classList.toggle('disabled', !this.historyCanRedo());
if (this.options.autohideToolbar) {
if (this.options.autohideToolbar && !this.isMobile) {
this._positionToolbar();
}
}