Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@editorjs/table",
"description": "Table for Editor.js",
"version": "2.4.5",
"version": "2.4.6",
"license": "MIT",
"repository": "https://github.com/editor-js/table",
"files": [
Expand Down
16 changes: 8 additions & 8 deletions src/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export default class Table {
label: this.api.i18n.t('Add column to left'),
icon: IconDirectionLeftDown,
hideIf: () => {
return this.numberOfColumns === this.config.maxcols
return this.numberOfColumns === this.config.maxCols
},
onClick: () => {
this.addColumn(this.selectedColumn, true);
Expand All @@ -198,7 +198,7 @@ export default class Table {
label: this.api.i18n.t('Add column to right'),
icon: IconDirectionRightDown,
hideIf: () => {
return this.numberOfColumns === this.config.maxcols
return this.numberOfColumns === this.config.maxCols
},
onClick: () => {
this.addColumn(this.selectedColumn + 1, true);
Expand Down Expand Up @@ -242,7 +242,7 @@ export default class Table {
label: this.api.i18n.t('Add row above'),
icon: IconDirectionUpRight,
hideIf: () => {
return this.numberOfRows === this.config.maxrows
return this.numberOfRows === this.config.maxRows
},
onClick: () => {
this.addRow(this.selectedRow, true);
Expand All @@ -253,7 +253,7 @@ export default class Table {
label: this.api.i18n.t('Add row below'),
icon: IconDirectionDownRight,
hideIf: () => {
return this.numberOfRows === this.config.maxrows
return this.numberOfRows === this.config.maxRows
},
onClick: () => {
this.addRow(this.selectedRow + 1, true);
Expand Down Expand Up @@ -366,7 +366,7 @@ export default class Table {
* Check if the number of columns has reached the maximum allowed columns specified in the configuration,
* and if so, exit the function to prevent adding more columns beyond the limit.
*/
if (this.config && this.config.maxcols && this.numberOfColumns >= this.config.maxcols) {
if (this.config && this.config.maxCols && this.numberOfColumns >= this.config.maxCols) {
return;
}

Expand Down Expand Up @@ -398,7 +398,7 @@ export default class Table {
}

const addColButton = this.wrapper.querySelector(`.${CSS.addColumn}`);
if (this.config?.maxcols && this.numberOfColumns > this.config.maxcols - 1 && addColButton ){
if (this.config?.maxCols && this.numberOfColumns > this.config.maxCols - 1 && addColButton ){
addColButton.classList.add(CSS.addColumnDisabled);
}
this.addHeadingAttrToFirstRow();
Expand Down Expand Up @@ -429,7 +429,7 @@ export default class Table {
* Check if the number of rows has reached the maximum allowed rows specified in the configuration,
* and if so, exit the function to prevent adding more columns beyond the limit.
*/
if (this.config && this.config.maxrows && this.numberOfRows >= this.config.maxrows && addRowButton) {
if (this.config && this.config.maxRows && this.numberOfRows >= this.config.maxRows && addRowButton) {
return;
}

Expand All @@ -454,7 +454,7 @@ export default class Table {
}

const addRowButton = this.wrapper.querySelector(`.${CSS.addRow}`);
if (this.config && this.config.maxrows && this.numberOfRows >= this.config.maxrows && addRowButton) {
if (this.config && this.config.maxRows && this.numberOfRows >= this.config.maxRows && addRowButton) {
addRowButton.classList.add(CSS.addRowDisabled);
}
return insertedRow;
Expand Down