Skip to content

Commit

Permalink
Merge pull request #1484 from Identity-labs/notice
Browse files Browse the repository at this point in the history
fix: remove notices catch in sentry
  • Loading branch information
JiHong88 authored Nov 26, 2024
2 parents 33a8e1a + 52af4c5 commit b29b2ab
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
4 changes: 2 additions & 2 deletions dist/suneditor.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "suneditor",
"version": "2.47.0",
"version": "2.47.1",
"description": "Vanilla javascript based WYSIWYG web editor, with no dependencies",
"author": "JiHong.Lee",
"license": "MIT",
Expand Down
28 changes: 16 additions & 12 deletions src/lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -6588,7 +6588,9 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re

event.removeGlobalEvent(event.__selectionSyncEvent);
event.__selectionSyncEvent = event.addGlobalEvent('mouseup', function() {
core._editorRange();
if (core) {
core._editorRange();
}
event.removeGlobalEvent(event.__selectionSyncEvent);
});

Expand Down Expand Up @@ -6670,7 +6672,7 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
const rangeEl = util.getRangeFormatElement(selectionNode, null);

let selectionNodeDeepestFirstChild = selectionNode;
while (selectionNodeDeepestFirstChild.firstChild) selectionNodeDeepestFirstChild = selectionNodeDeepestFirstChild.firstChild;
while (selectionNodeDeepestFirstChild && selectionNodeDeepestFirstChild.firstChild) selectionNodeDeepestFirstChild = selectionNodeDeepestFirstChild.firstChild;

const selectedComponentInfo = core.getFileComponent(selectionNodeDeepestFirstChild);
if (selectedComponentInfo) {
Expand Down Expand Up @@ -6716,10 +6718,12 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
},

_toggleToolbarBalloon: function () {
core._editorRange();
const range = core.getRange();
if (core._bindControllersOff || (!core._isBalloonAlways && range.collapsed)) event._hideToolbar();
else event._showToolbarBalloon(range);
if (core) {
core._editorRange();
const range = core.getRange();
if (core._bindControllersOff || (!core._isBalloonAlways && range.collapsed)) event._hideToolbar();
else event._showToolbarBalloon(range);
}
},

_showToolbarBalloon: function (rangeObj) {
Expand Down Expand Up @@ -7757,12 +7761,12 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
let currentCellFirstNode = currentCell;
let currentCellLastNode = currentCell;
if (currentCell) {
while (currentCellFirstNode.firstChild) currentCellFirstNode = currentCellFirstNode.firstChild;
while (currentCellLastNode.lastChild) currentCellLastNode = currentCellLastNode.lastChild;
while (currentCellFirstNode && currentCellFirstNode.firstChild) currentCellFirstNode = currentCellFirstNode.firstChild;
while (currentCellLastNode && currentCellLastNode.lastChild) currentCellLastNode = currentCellLastNode.lastChild;
}

let selectionNodeDeepestFirstChild = selectionNode;
while (selectionNodeDeepestFirstChild.firstChild) selectionNodeDeepestFirstChild = selectionNodeDeepestFirstChild.firstChild;
while (selectionNodeDeepestFirstChild && selectionNodeDeepestFirstChild.firstChild) selectionNodeDeepestFirstChild = selectionNodeDeepestFirstChild.firstChild;
const isCellFirstNode = (selectionNodeDeepestFirstChild === currentCellFirstNode);
const isCellLastNode = (selectionNodeDeepestFirstChild === currentCellLastNode);

Expand All @@ -7773,14 +7777,14 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
if (previousRow) siblingToSet = previousRow.children[currentCell.cellIndex];
else siblingToSet = util.getPreviousDeepestNode(table, core.context.element.wysiwyg);

while (siblingToSet.lastChild) siblingToSet = siblingToSet.lastChild;
while (siblingToSet && siblingToSet.lastChild) siblingToSet = siblingToSet.lastChild;
if (siblingToSet) offset = siblingToSet.textContent.length;
} else if (e.keyCode === 40 && isCellLastNode) { // DOWN
const nextRow = currentRow && currentRow.nextElementSibling;
if (nextRow) siblingToSet = nextRow.children[currentCell.cellIndex];
else siblingToSet = util.getNextDeepestNode(table, core.context.element.wysiwyg);

while (siblingToSet.firstChild) siblingToSet = siblingToSet.firstChild;
while (siblingToSet && siblingToSet.firstChild) siblingToSet = siblingToSet.firstChild;
}

if (siblingToSet) {
Expand Down Expand Up @@ -7831,7 +7835,7 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
}

let selectionNodeDeepestFirstChild = selectionNode;
while (selectionNodeDeepestFirstChild.firstChild) selectionNodeDeepestFirstChild = selectionNodeDeepestFirstChild.firstChild;
while (selectionNodeDeepestFirstChild && selectionNodeDeepestFirstChild.firstChild) selectionNodeDeepestFirstChild = selectionNodeDeepestFirstChild.firstChild;

const selectedComponentInfo = core.getFileComponent(selectionNodeDeepestFirstChild);
if (!(e.keyCode === 16 || e.shiftKey) && selectedComponentInfo) core.selectComponent(selectedComponentInfo.target, selectedComponentInfo.pluginName);
Expand Down

0 comments on commit b29b2ab

Please sign in to comment.