Skip to content

Commit

Permalink
fix - v2.28.4
Browse files Browse the repository at this point in the history
fix - v2.28.4
  • Loading branch information
JiHong88 committed Apr 7, 2020
2 parents fef22b9 + 30f3939 commit b7b3a1b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/suneditor.min.js

Large diffs are not rendered by default.

14 changes: 10 additions & 4 deletions src/plugins/submenu/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,17 +317,21 @@ export default {
tablePlugin.setPositionControllerDiv.call(this, tdElement, tablePlugin._shift);

const tableElement = contextTable._element;
const offset = this.util.getOffset(tableElement, this.context.element.wysiwygFrame);

contextTable._maxWidth = this.util.hasClass(tableElement, 'se-table-size-100') || tableElement.style.width === '100%' || (!tableElement.style.width && !this.util.hasClass(tableElement, 'se-table-size-auto'));
contextTable._fixedColumn = this.util.hasClass(tableElement, 'se-table-layout-fixed') || tableElement.style.tableLayout === 'fixed';
tablePlugin.setTableStyle.call(this, contextTable._maxWidth ? 'width|column' : 'width');

tablePlugin.setPositionControllerTop.call(this, tableElement);

if (!tablePlugin._shift) this.controllersOn(contextTable.resizeDiv, tableController, tablePlugin.init.bind(this), tdElement, 'table');
},

setPositionControllerTop: function (tableElement) {
const tableController = this.context.table.tableController;
const offset = this.util.getOffset(tableElement, this.context.element.wysiwygFrame);
tableController.style.left = offset.left + 'px';
tableController.style.display = 'block';
tableController.style.top = (offset.top - tableController.offsetHeight - 2) + 'px';

if (!tablePlugin._shift) this.controllersOn(contextTable.resizeDiv, tableController, tablePlugin.init.bind(this), tdElement, 'table');
},

setPositionControllerDiv: function (tdElement, reset) {
Expand Down Expand Up @@ -1411,11 +1415,13 @@ export default {
case 'resize':
contextTable._maxWidth = !contextTable._maxWidth;
tablePlugin.setTableStyle.call(this, 'width');
tablePlugin.setPositionControllerTop.call(this, contextTable._element);
tablePlugin.setPositionControllerDiv.call(this, contextTable._tdElement, tablePlugin._shift);
break;
case 'layout':
contextTable._fixedColumn = !contextTable._fixedColumn;
tablePlugin.setTableStyle.call(this, 'column');
tablePlugin.setPositionControllerTop.call(this, contextTable._element);
tablePlugin.setPositionControllerDiv.call(this, contextTable._tdElement, tablePlugin._shift);
break;
case 'remove':
Expand Down

0 comments on commit b7b3a1b

Please sign in to comment.