prosemirror-utils
Advanced tools
Comparing version 0.4.1 to 0.4.2
@@ -977,3 +977,3 @@ 'use strict'; | ||
// :: (columnIndex: number) → (tr: Transaction) → Transaction | ||
// Returns a new transaction that removes a column at index `columnIndex`. | ||
// Returns a new transaction that removes a column at index `columnIndex`. If there is only one column left, it will remove the entire table. | ||
// | ||
@@ -990,3 +990,5 @@ // ```javascript | ||
var map = prosemirrorTables.TableMap.get(table.node); | ||
if (columnIndex >= 0 && columnIndex <= map.width) { | ||
if (columnIndex === 0 && map.width === 1) { | ||
return removeTable(tr); | ||
} else if (columnIndex >= 0 && columnIndex <= map.width) { | ||
prosemirrorTables.removeColumn(tr, { | ||
@@ -1005,3 +1007,3 @@ map: map, | ||
// :: (rowIndex: number) → (tr: Transaction) → Transaction | ||
// Returns a new transaction that removes a row at index `rowIndex`. | ||
// Returns a new transaction that removes a row at index `rowIndex`. If there is only one row left, it will remove the entire table. | ||
// | ||
@@ -1018,3 +1020,5 @@ // ```javascript | ||
var map = prosemirrorTables.TableMap.get(table.node); | ||
if (rowIndex >= 0 && rowIndex <= map.height) { | ||
if (rowIndex === 0 && map.height === 1) { | ||
return removeTable(tr); | ||
} else if (rowIndex >= 0 && rowIndex <= map.height) { | ||
prosemirrorTables.removeRow(tr, { | ||
@@ -1021,0 +1025,0 @@ map: map, |
{ | ||
"name": "prosemirror-utils", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "Utils library for ProseMirror", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -343,3 +343,3 @@ # Utils library for ProseMirror | ||
* **`removeColumnAt`**`(columnIndex: number) → fn(tr: Transaction) → Transaction`\ | ||
Returns a new transaction that removes a column at index `columnIndex`. | ||
Returns a new transaction that removes a column at index `columnIndex`. If there is only one column left, it will remove the entire table. | ||
@@ -354,3 +354,3 @@ ```javascript | ||
* **`removeRowAt`**`(rowIndex: number) → fn(tr: Transaction) → Transaction`\ | ||
Returns a new transaction that removes a row at index `rowIndex`. | ||
Returns a new transaction that removes a row at index `rowIndex`. If there is only one row left, it will remove the entire table. | ||
@@ -357,0 +357,0 @@ ```javascript |
Sorry, the diff of this file is not supported yet
135961
1248