Skip to content

Commit 9efc077

Browse files
committed
fix rebase
1 parent 274f842 commit 9efc077

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

addons/html_editor/static/src/main/font/color_plugin.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,11 @@ export class ColorPlugin extends Plugin {
146146
}
147147
}
148148

149-
this.selectedColors.color =
150-
hasGradient && hasTextGradientClass ? backgroundImage : rgbaToHex(elStyle.color);
151-
this.selectedColors.backgroundColor =
152-
hasGradient && !hasTextGradientClass ? backgroundImage : rgbaToHex(backgroundColor);
149+
return {
150+
color: hasGradient && hasTextGradientClass ? backgroundImage : rgbaToHex(elStyle.color),
151+
backgroundColor:
152+
hasGradient && !hasTextGradientClass ? backgroundImage : rgbaToHex(backgroundColor),
153+
};
153154
}
154155

155156
/**

addons/html_editor/static/src/main/power_buttons_plugin.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export class PowerButtonsPlugin extends Plugin {
7777
const btn = this.document.createElement("button");
7878
let className = "power_button btn px-2 py-1 cursor-pointer";
7979
if (icon) {
80-
let iconLibrary = icon.includes("fa-") ? "fa" : "oi";
80+
const iconLibrary = icon.includes("fa-") ? "fa" : "oi";
8181
className += ` ${iconLibrary} ${icon}`;
8282
} else {
8383
const span = this.document.createElement("span");
@@ -138,15 +138,16 @@ export class PowerButtonsPlugin extends Plugin {
138138
}
139139

140140
getPlaceholderWidth(block) {
141-
this.dependencies.history.disableObserver();
142-
const clone = block.cloneNode(true);
143-
clone.innerText = clone.getAttribute("o-we-hint-text");
144-
clone.style.width = "fit-content";
145-
clone.style.visibility = "hidden";
146-
this.editable.appendChild(clone);
147-
const { width } = clone.getBoundingClientRect();
148-
this.editable.removeChild(clone);
149-
this.dependencies.history.enableObserver();
141+
let width;
142+
this.dependencies.history.ignoreDOMMutations(() => {
143+
const clone = block.cloneNode(true);
144+
clone.innerText = clone.getAttribute("o-we-hint-text");
145+
clone.style.width = "fit-content";
146+
clone.style.visibility = "hidden";
147+
this.editable.appendChild(clone);
148+
width = clone.getBoundingClientRect().width;
149+
this.editable.removeChild(clone);
150+
});
150151
return width;
151152
}
152153

0 commit comments

Comments
 (0)