Skip to content

Commit ceb7e36

Browse files
committed
PB-170: TinyMCE Performance is very poor with multiple instances on Stage
- Fix slider not always initializing
1 parent cfd35a9 commit ceb7e36

File tree

8 files changed

+23
-8
lines changed

8 files changed

+23
-8
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/banner/preview.js

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/slide/preview.js

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/text/preview.js

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/utils/editor.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/banner/preview.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,16 @@ export default class Preview extends BasePreview {
194194
* @returns {Boolean}
195195
*/
196196
public activateEditor(preview: Preview, event: JQueryEventObject) {
197-
if (this.element && !this.wysiwyg && !this.handledDoubleClick) {
197+
if (this.element && !this.wysiwyg) {
198198
const bookmark = createBookmark(event);
199199
lockImageSize(this.element);
200200
this.element.removeAttribute("contenteditable");
201201
_.defer(() => {
202202
this.initWysiwygFromClick(true)
203203
.then(() => delayUntil(
204204
() => {
205+
// We no longer need to handle double click once it's initialized
206+
this.handledDoubleClick = true;
205207
this.wysiwygDeferred.resolve();
206208
moveToBookmark(bookmark);
207209
unlockImageSize(this.element);

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/slide/preview.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,16 @@ export default class Preview extends BasePreview {
188188
* @returns {Boolean}
189189
*/
190190
public activateEditor(preview: Preview, event: JQueryEventObject) {
191-
if (this.element && !this.wysiwyg && !this.handledDoubleClick) {
191+
if (this.element && !this.wysiwyg) {
192192
const bookmark = createBookmark(event);
193193
lockImageSize(this.element);
194194
this.element.removeAttribute("contenteditable");
195195
_.defer(() => {
196196
this.initWysiwygFromClick(true)
197197
.then(() => delayUntil(
198198
() => {
199+
// We no longer need to handle double click once it's initialized
200+
this.handledDoubleClick = true;
199201
this.wysiwygDeferred.resolve();
200202
moveToBookmark(bookmark);
201203
unlockImageSize(this.element);

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/text/preview.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,16 @@ export default class Preview extends BasePreview {
181181
* @returns {Boolean}
182182
*/
183183
public activateEditor(preview: Preview, event: JQueryEventObject) {
184-
if (this.element && !this.wysiwyg && !this.handledDoubleClick) {
184+
if (this.element && !this.wysiwyg) {
185185
const bookmark = createBookmark(event);
186186
lockImageSize(this.element);
187187
this.element.removeAttribute("contenteditable");
188188
_.defer(() => {
189189
this.initWysiwygFromClick(true)
190190
.then(() => delayUntil(
191191
() => {
192+
// We no longer need to handle double click once it's initialized
193+
this.handledDoubleClick = true;
192194
this.wysiwygDeferred.resolve();
193195
moveToBookmark(bookmark);
194196
unlockImageSize(this.element);

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/utils/editor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function encodeContent(content: string) {
3434
}
3535

3636
/**
37-
* Prior to parsing the content remove and invalid placeholders within the content
37+
* Prior to parsing the content remove any invalid placeholders within the content
3838
*
3939
* @param content
4040
*/

0 commit comments

Comments
 (0)