Skip to content

Commit

Permalink
fix: #194, #195
Browse files Browse the repository at this point in the history
  • Loading branch information
JiHong88 committed Jan 31, 2020
1 parent 2809603 commit a4d2dce
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
20 changes: 10 additions & 10 deletions src/lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
},

Expand Down
3 changes: 3 additions & 0 deletions src/plugins/submenu/align.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,8 @@ export default {

this.submenuOff();
this.focus();

// history stack
core.history.push(false);
}
};
3 changes: 2 additions & 1 deletion test/dev/suneditor_build_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
{
Expand Down

0 comments on commit a4d2dce

Please sign in to comment.