@syncfusion/ej2-richtexteditor 25.2.5 → 25.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 25.2.5
3
+ * version : 25.2.6
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-richtexteditor@*",
3
- "_id": "@syncfusion/ej2-richtexteditor@25.2.4",
3
+ "_id": "@syncfusion/ej2-richtexteditor@25.2.5",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-axjlW/M2AfJzH2TUhZ6jxy0E69gZEmC+Oxm+OBXnGOWNez043U4Nw8uw+eV/UuK52BrzdX0n99k9vxWwlIoKcw==",
5
+ "_integrity": "sha512-NonOxrKU+s4Zp5Miu995Sz33nwGR7Fw3cctfKMWUHH7ihn3sQyS8G55fS5//aypH1+fcqioRLz/MmYHsvUCPfA==",
6
6
  "_location": "/@syncfusion/ej2-richtexteditor",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -25,8 +25,8 @@
25
25
  "/@syncfusion/ej2-react-richtexteditor",
26
26
  "/@syncfusion/ej2-vue-richtexteditor"
27
27
  ],
28
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-25.2.4.tgz",
29
- "_shasum": "b32bf82ce555a4b5b2905f206d207d22866194fd",
28
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-25.2.5.tgz",
29
+ "_shasum": "7d9d112209d8b618a69fdceb055dfa89af2472c4",
30
30
  "_spec": "@syncfusion/ej2-richtexteditor@*",
31
31
  "_where": "/jenkins/workspace/elease-automation_release_25.1.1/packages/included",
32
32
  "author": {
@@ -38,11 +38,11 @@
38
38
  "bundleDependencies": false,
39
39
  "dependencies": {
40
40
  "@syncfusion/ej2-base": "~25.2.5",
41
- "@syncfusion/ej2-buttons": "~25.2.4",
42
- "@syncfusion/ej2-filemanager": "~25.2.3",
43
- "@syncfusion/ej2-inputs": "~25.2.5",
44
- "@syncfusion/ej2-navigations": "~25.2.4",
45
- "@syncfusion/ej2-popups": "~25.2.4",
41
+ "@syncfusion/ej2-buttons": "~25.2.6",
42
+ "@syncfusion/ej2-filemanager": "~25.2.6",
43
+ "@syncfusion/ej2-inputs": "~25.2.6",
44
+ "@syncfusion/ej2-navigations": "~25.2.6",
45
+ "@syncfusion/ej2-popups": "~25.2.6",
46
46
  "@syncfusion/ej2-splitbuttons": "~25.2.4"
47
47
  },
48
48
  "deprecated": false,
@@ -79,6 +79,6 @@
79
79
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
80
80
  },
81
81
  "typings": "index.d.ts",
82
- "version": "25.2.5",
82
+ "version": "25.2.6",
83
83
  "sideEffects": false
84
84
  }
@@ -89,3 +89,17 @@ export interface IImageResizeFactor {
89
89
  botLeft: [number, number];
90
90
  botRight: [number, number];
91
91
  }
92
+ /**
93
+ * The `ImageOrTableCursor` is used to specify the image or table cursor in Enter key Module.
94
+ *
95
+ * @private
96
+ * @hidden
97
+ *
98
+ *
99
+ * */
100
+ export interface ImageOrTableCursor {
101
+ start: boolean;
102
+ startName: string;
103
+ end: boolean;
104
+ endName: string;
105
+ }
@@ -255,7 +255,7 @@ var Lists = /** @class */ (function () {
255
255
  e.event.preventDefault();
256
256
  }
257
257
  };
258
- Lists.prototype.onKeyUp = function () {
258
+ Lists.prototype.onKeyUp = function (e) {
259
259
  if (!isNOU(this.commonLIParent) && !isNOU(this.commonLIParent.querySelector('.removeList'))) {
260
260
  var currentLIElem = this.commonLIParent.querySelector('.removeList');
261
261
  while (!isNOU(currentLIElem.firstChild)) {
@@ -263,6 +263,14 @@ var Lists = /** @class */ (function () {
263
263
  }
264
264
  detach(currentLIElem);
265
265
  }
266
+ if (e.event.keyCode === 13) {
267
+ var listElements = this.parent.editableElement.querySelectorAll('UL, OL');
268
+ for (var i = 0; i < listElements.length; i++) {
269
+ if (!isNullOrUndefined(listElements[i]) && !isNullOrUndefined(listElements[i].parentElement) && !isNullOrUndefined(listElements[i].previousElementSibling) && (listElements[i].parentElement.nodeName === 'UL' || listElements[i].parentElement.nodeName === 'OL')) {
270
+ listElements[i].previousElementSibling.appendChild(listElements[i]);
271
+ }
272
+ }
273
+ }
266
274
  };
267
275
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
268
276
  Lists.prototype.firstListBackSpace = function (range, _e) {
@@ -504,6 +512,8 @@ var Lists = /** @class */ (function () {
504
512
  else {
505
513
  if (prevSibling.tagName === 'LI') {
506
514
  var nestedElement = createElement(elements[i].parentNode.tagName);
515
+ nestedElement.style.listStyleType =
516
+ elements[i].parentNode.style.listStyleType;
507
517
  append([nestedElement], prevSibling);
508
518
  append([elements[i]], nestedElement);
509
519
  }
@@ -611,7 +621,7 @@ var Lists = /** @class */ (function () {
611
621
  }
612
622
  var elemAtt = void 0;
613
623
  elements[i].style.removeProperty('margin-left');
614
- elemAtt = elements[i].tagName === 'IMG' ? '' : this.domNode.attributes(elements[i]);
624
+ elemAtt = elements[i].tagName === 'IMG' || elements[i].classList.contains('e-editor-select-start') ? '' : this.domNode.attributes(elements[i]);
615
625
  if (elements[i].getAttribute('contenteditable') === 'true'
616
626
  && elements[i].childNodes.length === 1 && elements[i].childNodes[0].nodeName === 'TABLE') {
617
627
  var listEle = document.createElement(type);
@@ -735,6 +745,13 @@ var Lists = /** @class */ (function () {
735
745
  for (var c = 0; c < liParents.length; c++) {
736
746
  var node = liParents[c];
737
747
  var toFindtopOlUl = true;
748
+ var containsListElements = node;
749
+ while (containsListElements.parentElement) {
750
+ if (containsListElements.parentElement && containsListElements.parentElement.tagName !== 'LI' && containsListElements.parentElement.tagName !== 'OL' && containsListElements.parentElement.tagName !== 'UL') {
751
+ break;
752
+ }
753
+ containsListElements = containsListElements.parentElement;
754
+ }
738
755
  if (toFindtopOlUl && (liParents[c].parentElement.parentElement.nodeName === 'OL' || liParents[c].parentElement.parentElement.nodeName === 'UL')) {
739
756
  toFindtopOlUl = false;
740
757
  var preElement = liParents[c].parentElement.parentElement;
@@ -754,9 +771,43 @@ var Lists = /** @class */ (function () {
754
771
  node.previousElementSibling.lastChild.append(node);
755
772
  }
756
773
  }
774
+ else if (this.domNode.isList(node.previousElementSibling) && containsListElements.contains(node.previousElementSibling) && ((node.tagName === 'OL' || node.tagName === 'UL') && (node.previousElementSibling.nodeName === 'OL' || node.previousElementSibling.nodeName === 'UL'))) {
775
+ var contentNodes = this.domNode.contents(node);
776
+ for (var f = 0; f < contentNodes.length; f++) {
777
+ node.previousElementSibling.appendChild(contentNodes[f]);
778
+ }
779
+ node.parentNode.removeChild(node);
780
+ }
757
781
  }
758
782
  if (firstNodeOL) {
759
783
  firstNodeOL.style.listStyleType = listStyleType;
784
+ var range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
785
+ var listOlUlElements = [];
786
+ if (range.commonAncestorContainer.nodeName === 'UL' || range.commonAncestorContainer.nodeName === 'OL') {
787
+ if (range.commonAncestorContainer instanceof Element) {
788
+ listOlUlElements.push(range.commonAncestorContainer);
789
+ }
790
+ listOlUlElements = listOlUlElements.concat(Array.from(range.commonAncestorContainer.querySelectorAll('ol, ul')));
791
+ }
792
+ else {
793
+ listOlUlElements = Array.from(range.commonAncestorContainer.querySelectorAll('ol, ul'));
794
+ }
795
+ for (var k = 0; k < listOlUlElements.length; k++) {
796
+ var listStyle = void 0;
797
+ var listElements = listOlUlElements[k];
798
+ while (listElements) {
799
+ if (listElements.nodeName === 'OL' || listElements.nodeName === 'OL') {
800
+ if (listElements.style.listStyleType !== '' && listElements.style.listStyleType !== 'none' && listElements.nodeName !== 'LI') {
801
+ listStyle = listElements.style.listStyleType;
802
+ }
803
+ else if (!isNOU(listStyle) && (listElements.style.listStyleType === '' || listElements.style.listStyleType === 'none') &&
804
+ listElements.nodeName !== 'LI' && (listElements.nodeName === 'UL' || listElements.nodeName === 'OL')) {
805
+ listElements.style.listStyleType = listStyle;
806
+ }
807
+ }
808
+ listElements = listElements.querySelector('UL,OL');
809
+ }
810
+ }
760
811
  }
761
812
  };
762
813
  Lists.prototype.findUnSelected = function (temp, elements) {
@@ -821,7 +821,7 @@ var MsWordPaste = /** @class */ (function () {
821
821
  !isNormalList) {
822
822
  prevList = null;
823
823
  }
824
- var pElement = createElement('p', { className: 'MsoNormal' });
824
+ var pElement = createElement('p', { className: 'MsoNoSpacing' });
825
825
  pElement.innerHTML = collection[index].content.join(' ');
826
826
  if ((collection[index].nestedLevel === 1) &&
827
827
  (listCount === 0 || lfo !== collection[index].listFormatOverride) &&
@@ -19,5 +19,10 @@ export declare class EnterKeyAction {
19
19
  private insertBRElement;
20
20
  private insertFocusContent;
21
21
  private createInsertElement;
22
+ private triggerActionComplete;
22
23
  private handleCursorAtTableSide;
24
+ private handleEnterKeyAtImageSide;
25
+ private isTableOrImageStart;
26
+ private isTableOrImageEnd;
27
+ private processedTableImageCursor;
23
28
  }
@@ -39,16 +39,18 @@ var EnterKeyAction = /** @class */ (function () {
39
39
  this.getRangeNode();
40
40
  var isTableEnter = true;
41
41
  this.formatTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote'];
42
- var isCursorAtTableEnd = this.range.collapsed && (this.range.startContainer.nodeType === 1) &&
43
- this.range.startContainer.isContentEditable &&
44
- this.range.startContainer.childNodes[this.range.startOffset - 1] &&
45
- this.range.startContainer.childNodes[this.range.startOffset - 1].nodeName === 'TABLE';
46
- var isCursorAtTableStart = this.range.collapsed && (this.range.startContainer.nodeType === 1) &&
47
- this.range.startContainer.isContentEditable && this.range.startContainer.childNodes[this.range.startOffset] &&
48
- this.range.startContainer.childNodes[this.range.startOffset].nodeName === 'TABLE';
49
- if (isCursorAtTableEnd || isCursorAtTableStart) {
50
- this.handleCursorAtTableSide(e, isCursorAtTableStart, isCursorAtTableEnd);
51
- return;
42
+ var tableImagCursor = this.processedTableImageCursor();
43
+ if (tableImagCursor.start || tableImagCursor.end) {
44
+ if (tableImagCursor.startName === 'TABLE' || tableImagCursor.endName === 'TABLE') { // Default browser action prevented and hanled manually.
45
+ this.handleCursorAtTableSide(e, tableImagCursor.start, tableImagCursor.end);
46
+ return;
47
+ }
48
+ }
49
+ if (tableImagCursor.start || tableImagCursor.end || this.range.startContainer.nodeName === 'IMG') {
50
+ if (this.parent.enterKey === 'BR' && (tableImagCursor.startName === 'IMG' || tableImagCursor.endName === 'IMG' || this.range.startContainer.nodeName === 'IMG')) { // Default browser action prevented and hanled manually.
51
+ this.handleEnterKeyAtImageSide(e, tableImagCursor.start, tableImagCursor.end);
52
+ return;
53
+ }
52
54
  }
53
55
  if (!isNOU(this.startNode.closest('TABLE')) && !isNOU(this.endNode.closest('TABLE'))) {
54
56
  isTableEnter = false;
@@ -417,7 +419,6 @@ var EnterKeyAction = /** @class */ (function () {
417
419
  var outerBRElem = _this.parent.createElement('br');
418
420
  if (_this.range.startOffset === 0 && _this.range.endOffset === 0 &&
419
421
  !isNOU(currentParent.previousSibling) && currentParent.previousSibling.nodeName === 'BR' && currentParent.nodeName !== 'P' && currentParent.nodeName !== 'DIV') {
420
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
421
422
  newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, currentParent, false).cloneNode(true);
422
423
  _this.parent.formatter.editorManager.domNode.insertAfter(outerBRElem, currentParent);
423
424
  _this.insertFocusContent();
@@ -447,7 +448,7 @@ var EnterKeyAction = /** @class */ (function () {
447
448
  }
448
449
  e.args.preventDefault();
449
450
  }
450
- _this.parent.trigger(events.actionComplete, { requestType: shiftKey_1 ? 'ShiftEnterAction' : 'EnterAction', args: e.args });
451
+ _this.triggerActionComplete(e, shiftKey_1);
451
452
  }
452
453
  });
453
454
  }
@@ -517,6 +518,9 @@ var EnterKeyAction = /** @class */ (function () {
517
518
  }
518
519
  return insertElem;
519
520
  };
521
+ EnterKeyAction.prototype.triggerActionComplete = function (e, shiftKey) {
522
+ this.parent.trigger(events.actionComplete, { requestType: shiftKey ? 'ShiftEnterAction' : 'EnterAction', args: e.args });
523
+ };
520
524
  EnterKeyAction.prototype.handleCursorAtTableSide = function (e, isStart, isEnd) {
521
525
  var _this = this;
522
526
  if (this.parent.enterKey !== 'BR') {
@@ -547,11 +551,92 @@ var EnterKeyAction = /** @class */ (function () {
547
551
  }
548
552
  _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), newElement, 0);
549
553
  e.args.preventDefault();
550
- _this.parent.trigger(events.actionComplete, { requestType: shiftKey_2 ? 'ShiftEnterAction' : 'EnterAction', args: e.args });
554
+ _this.triggerActionComplete(e, shiftKey_2);
551
555
  }
552
556
  });
553
557
  }
554
558
  };
559
+ EnterKeyAction.prototype.handleEnterKeyAtImageSide = function (e, isStart, isEnd) {
560
+ var _this = this;
561
+ var actionBeginArgs = {
562
+ cancel: false,
563
+ name: events.actionBegin,
564
+ requestType: e.args.shiftKey ? 'ShiftEnterAction' : 'EnterAction',
565
+ originalEvent: e.args
566
+ };
567
+ var directRange = false;
568
+ if (this.range.startContainer.nodeName === 'IMG' && this.range.startOffset === 0) {
569
+ directRange = true;
570
+ }
571
+ this.parent.trigger(events.actionBegin, actionBeginArgs, function (actionBeginArgs) {
572
+ if (!actionBeginArgs.cancel) {
573
+ if (_this.parent.enterKey === 'BR') {
574
+ var newElement = _this.parent.createElement('BR');
575
+ var imageElement = void 0;
576
+ if (directRange) {
577
+ imageElement = _this.range.startContainer;
578
+ imageElement.parentElement.insertBefore(newElement, imageElement);
579
+ _this.parent.formatter.editorManager.nodeSelection.
580
+ setCursorPoint(_this.parent.contentModule.getDocument(), imageElement, 0);
581
+ }
582
+ if (isStart) {
583
+ imageElement = _this.range.startContainer.childNodes[_this.range.startOffset];
584
+ imageElement.parentElement.insertBefore(newElement, imageElement);
585
+ _this.parent.formatter.editorManager.nodeSelection.
586
+ setCursorPoint(_this.parent.contentModule.getDocument(), imageElement, 0);
587
+ }
588
+ if (isEnd) {
589
+ imageElement = _this.range.startContainer.childNodes[_this.range.startOffset - 1];
590
+ if (!isNOU(imageElement.nextSibling)) {
591
+ imageElement.parentElement.insertBefore(newElement, imageElement.nextSibling);
592
+ _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), newElement.nextSibling, 0);
593
+ }
594
+ else if (isNOU(imageElement.nextSibling)) {
595
+ imageElement.parentElement.appendChild(newElement);
596
+ var brElement = _this.parent.createElement('BR');
597
+ imageElement.parentElement.appendChild(brElement);
598
+ _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), brElement, 0);
599
+ }
600
+ }
601
+ e.args.preventDefault();
602
+ _this.triggerActionComplete(e, e.args.shiftKey);
603
+ }
604
+ }
605
+ });
606
+ };
607
+ EnterKeyAction.prototype.isTableOrImageStart = function () {
608
+ var customHandlerElements = ['IMG', 'TABLE'];
609
+ var startContainer = this.range.startContainer;
610
+ var startOffset = this.range.startOffset;
611
+ var isCursorAtStart = this.range.collapsed && (startContainer.nodeType === 1) &&
612
+ startContainer.isContentEditable && startContainer.childNodes[startOffset] &&
613
+ (customHandlerElements.indexOf(startContainer.childNodes[startOffset].nodeName) > -1);
614
+ if (isCursorAtStart) {
615
+ return { start: isCursorAtStart, startNodeName: startContainer.childNodes[startOffset].nodeName };
616
+ }
617
+ else {
618
+ return { start: false, startNodeName: '' };
619
+ }
620
+ };
621
+ EnterKeyAction.prototype.isTableOrImageEnd = function () {
622
+ var customHandlerElements = ['IMG', 'TABLE'];
623
+ var startContainer = this.range.startContainer;
624
+ var startOffset = this.range.startOffset;
625
+ var isCursorAtEnd = this.range.collapsed && (startContainer.nodeType === 1) &&
626
+ startContainer.isContentEditable && startContainer.childNodes[startOffset - 1] &&
627
+ (customHandlerElements.indexOf(startContainer.childNodes[startOffset - 1].nodeName) > -1);
628
+ if (isCursorAtEnd) {
629
+ return { end: isCursorAtEnd, endNodeName: startContainer.childNodes[startOffset - 1].nodeName };
630
+ }
631
+ else {
632
+ return { end: false, endNodeName: '' };
633
+ }
634
+ };
635
+ EnterKeyAction.prototype.processedTableImageCursor = function () {
636
+ var _a = this.isTableOrImageStart(), start = _a.start, startNodeName = _a.startNodeName;
637
+ var _b = this.isTableOrImageEnd(), end = _b.end, endNodeName = _b.endNodeName;
638
+ return { start: start, startName: startNodeName, end: end, endName: endNodeName };
639
+ };
555
640
  return EnterKeyAction;
556
641
  }());
557
642
  export { EnterKeyAction };
@@ -292,7 +292,7 @@ var HtmlEditor = /** @class */ (function () {
292
292
  var range = this.nodeSelectionObj.getRange(this.contentRenderer.getDocument());
293
293
  var parentNode = this.nodeSelectionObj.getParentNodeCollection(range);
294
294
  if (!((parentNode[0].nodeName === 'LI' || closest(parentNode[0], 'li') ||
295
- closest(parentNode[0], 'table')) && range.startOffset === 0)) {
295
+ closest(parentNode[0], 'table')))) {
296
296
  args.preventDefault();
297
297
  var selection = this.contentRenderer.getDocument().getSelection().getRangeAt(0);
298
298
  var alignmentNodes = this.parent.formatter.editorManager.domNode.blockNodes();
@@ -674,7 +674,8 @@ var PasteCleanup = /** @class */ (function () {
674
674
  clipBoardElem = this.allowedStyle(clipBoardElem);
675
675
  }
676
676
  this.saveSelection.restore();
677
- clipBoardElem.innerHTML = this.sanitizeHelper(clipBoardElem.innerHTML);
677
+ var newText = clipBoardElem.innerHTML.split("&").join("&amp;");
678
+ clipBoardElem.innerHTML = this.sanitizeHelper(newText);
678
679
  var allImg = clipBoardElem.querySelectorAll('img');
679
680
  for (var i = 0; i < allImg.length; i++) {
680
681
  if (!isNOU(allImg[i].getAttribute('src'))) {
@@ -1330,6 +1330,7 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
1330
1330
  updateValueData(): void;
1331
1331
  private removeSheets;
1332
1332
  private updatePanelValue;
1333
+ private listOrderCorrection;
1333
1334
  private setHeight;
1334
1335
  /**
1335
1336
  * setPlaceHolder method
@@ -1425,7 +1425,7 @@ var RichTextEditor = /** @class */ (function (_super) {
1425
1425
  }
1426
1426
  };
1427
1427
  RichTextEditor.prototype.updatePanelValue = function () {
1428
- var value = this.value;
1428
+ var value = this.listOrderCorrection(this.value);
1429
1429
  value = (this.enableHtmlEncode && this.value) ? decode(value) : value;
1430
1430
  var getTextArea = this.element.querySelector('.' + classes.CLS_RTE_SOURCE_CODE_TXTAREA);
1431
1431
  if (value) {
@@ -1469,6 +1469,17 @@ var RichTextEditor = /** @class */ (function (_super) {
1469
1469
  this.countModule.refresh();
1470
1470
  }
1471
1471
  };
1472
+ RichTextEditor.prototype.listOrderCorrection = function (value) {
1473
+ var valueElementWrapper = this.createElement('div');
1474
+ valueElementWrapper.innerHTML = value;
1475
+ var listElements = valueElementWrapper.querySelectorAll('UL, OL');
1476
+ for (var i = 0; i < listElements.length; i++) {
1477
+ if (!isNOU(listElements[i]) && !isNOU(listElements[i].parentElement) && !isNOU(listElements[i].previousElementSibling) && (listElements[i].parentElement.nodeName === 'UL' || listElements[i].parentElement.nodeName === 'OL')) {
1478
+ listElements[i].previousElementSibling.appendChild(listElements[i]);
1479
+ }
1480
+ }
1481
+ return valueElementWrapper.innerHTML;
1482
+ };
1472
1483
  RichTextEditor.prototype.setHeight = function (height) {
1473
1484
  if (height !== 'auto') {
1474
1485
  this.element.style.height = formatUnit(height);
@@ -624,13 +624,13 @@ var Image = /** @class */ (function () {
624
624
  selectParentEle = this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range);
625
625
  if (!originalEvent.ctrlKey && originalEvent.key && (originalEvent.key.length === 1 || originalEvent.action === 'enter') &&
626
626
  (!isNOU(selectParentEle[0]) && selectParentEle[0].tagName === 'IMG') && selectParentEle[0].parentElement) {
627
- var prev = selectParentEle[0].parentElement.childNodes[0];
628
627
  if (this.contentModule.getEditPanel().querySelector('.e-img-resize')) {
629
628
  this.removeResizeEle();
630
629
  }
631
- this.parent.formatter.editorManager.nodeSelection.setSelectionText(this.contentModule.getDocument(), prev, prev, prev.textContent.length, prev.textContent.length);
632
630
  removeClass([selectParentEle[0]], 'e-img-focus');
633
- this.quickToolObj.imageQTBar.hidePopup();
631
+ if (this.quickToolObj && this.quickToolObj.imageQTBar) {
632
+ this.quickToolObj.imageQTBar.hidePopup();
633
+ }
634
634
  }
635
635
  }
636
636
  if (originalEvent.ctrlKey && (originalEvent.keyCode === 89 || originalEvent.keyCode === 90)) {