diff --git a/src/lib/core.js b/src/lib/core.js index e3586a783..f98995245 100755 --- a/src/lib/core.js +++ b/src/lib/core.js @@ -3663,18 +3663,18 @@ export default function (context, pluginCallButtons, plugins, lang, _options) { * @warning Events are registered only when there is a table plugin. */ onMouseDown_wysiwyg: function (e) { - if (core._isBalloon) { - event._hideToolbar(); - } - const tableCell = util.getParentElement(e.target, util.isCell); - if (!tableCell) return; + if (tableCell) { + const tablePlugin = core.plugins.table; + if (tableCell !== tablePlugin._fixedCell && !tablePlugin._shift) { + core.callPlugin('table', function () { + tablePlugin.onTableCellMultiSelect.call(core, tableCell, false); + }); + } + } - const tablePlugin = core.plugins.table; - if (tableCell !== tablePlugin._fixedCell && !tablePlugin._shift) { - core.callPlugin('table', function () { - tablePlugin.onTableCellMultiSelect.call(core, tableCell, false); - }); + if (core._isBalloon) { + event._hideToolbar(); } }, diff --git a/src/plugins/submenu/align.js b/src/plugins/submenu/align.js index cbdf866ba..b76da4ffb 100644 --- a/src/plugins/submenu/align.js +++ b/src/plugins/submenu/align.js @@ -89,5 +89,8 @@ export default { this.submenuOff(); this.focus(); + + // history stack + core.history.push(false); } }; diff --git a/test/dev/suneditor_build_test.js b/test/dev/suneditor_build_test.js index 68f4cfcab..7253d68e8 100644 --- a/test/dev/suneditor_build_test.js +++ b/test/dev/suneditor_build_test.js @@ -20,7 +20,8 @@ const align = require('../../src/plugins/submenu/align') let s1 = suneditor.create('editor', { plugins: plugins, - buttonList: [['align', 'link', 'bold', 'underline', 'italic', 'strike', 'fontColor', 'hiliteColor', 'removeFormat', 'formatBlock', 'codeView', 'preview']], + mode: 'balloon', + buttonList: [['table', 'align', 'link', 'bold', 'underline', 'italic', 'strike', 'fontColor', 'hiliteColor', 'removeFormat', 'formatBlock', 'codeView', 'preview']], width: '100%', formats: [ {