Skip to content

Commit 5be12c2

Browse files
committed
Update statusbar
Fix #18
1 parent b0bdb76 commit 5be12c2

File tree

4 files changed

+26
-10
lines changed

4 files changed

+26
-10
lines changed

plugins/JSSV8/dist/statusbar.min.js

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/JSSV8/src/statusbar/index.js

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Plugin statusbar for JSpreadsheet Pro
33
*
4-
* @version 2.3.5
4+
* @version 2.3.6
55
* @author Guillaume Bonnaire <contact@gbonnaire.fr>
66
* @website https://repo.gbonnaire.fr
77
* @summary Add status bar on bottom of JSpreadsheet
@@ -30,6 +30,7 @@
3030
*
3131
* @description Status bar is a plugin for add a status bar on bottom of the sheet like Excel. On this status bar you can add new row with button, and show information on selection (Range selected, Formulas, etc.)
3232
* Release notes
33+
* Version 2.3.6: Fix #18
3334
* Version 2.3.5: Fix #17
3435
* Version 2.3.4: Fix #16
3536
* Version 2.3.3: Manage after change cell content
@@ -165,7 +166,9 @@
165166
if (worksheet.options.allowInsertRow) {
166167
// Detect if need insert or add the end
167168
if((worksheet.getSelectedRows(true).length == 1 && worksheet.getSelectedColumns().length == worksheet.options.data[0].length) || plugin.options.closeInsertionOnly) {
168-
worksheet.insertRow(parseInt(inputAddQuantity.value), getMaxPosition(worksheet.getSelectedRows(true)));
169+
if(worksheet.selectedCell) {
170+
worksheet.insertRow(parseInt(inputAddQuantity.value), getMaxPosition(worksheet.getSelectedRows(true)));
171+
}
169172
} else {
170173
worksheet.goto(worksheet.options.data.length,getMinPosition(worksheet.getSelectedColumns()));
171174
worksheet.insertRow(parseInt(inputAddQuantity.value));
@@ -182,7 +185,9 @@
182185
if (worksheet.options.allowInsertRow) {
183186
// Detect if need insert or add the end
184187
if((worksheet.getSelectedRows(true).length == 1 && worksheet.getSelectedColumns().length == worksheet.options.data[0].length) || plugin.options.closeInsertionOnly) {
185-
worksheet.insertRow(parseInt(inputAddQuantity.value), getMinPosition(worksheet.getSelectedRows(true)), true);
188+
if(worksheet.selectedCell) {
189+
worksheet.insertRow(parseInt(inputAddQuantity.value), getMinPosition(worksheet.getSelectedRows(true)), true);
190+
}
186191
} else {
187192
worksheet.goto(0,getMinPosition(worksheet.getSelectedColumns()));
188193
worksheet.insertRow(parseInt(inputAddQuantity.value), 0 , true);
@@ -199,7 +204,9 @@
199204
if (worksheet.options.allowInsertColumn) {
200205
// Detect if need insert or add the end
201206
if((worksheet.getSelectedColumns().length == 1 && worksheet.getSelectedRows(true).length == worksheet.options.data.length) || plugin.options.closeInsertionOnly) {
202-
worksheet.insertColumn(parseInt(inputAddQuantity.value), getMaxPosition(worksheet.getSelectedColumns()));
207+
if(worksheet.selectedCell) {
208+
worksheet.insertColumn(parseInt(inputAddQuantity.value), getMaxPosition(worksheet.getSelectedColumns()));
209+
}
203210
} else {
204211
worksheet.goto(getMinPosition(worksheet.getSelectedRows(true)),worksheet.options.data[0].length);
205212
worksheet.insertColumn(parseInt(inputAddQuantity.value));
@@ -216,7 +223,9 @@
216223
if (worksheet.options.allowInsertColumn) {
217224
// Detect if need insert or add the end
218225
if((worksheet.getSelectedColumns().length == 1 && worksheet.getSelectedRows(true).length == worksheet.options.data.length) || plugin.options.closeInsertionOnly) {
219-
worksheet.insertColumn(parseInt(inputAddQuantity.value), getMinPosition(worksheet.getSelectedColumns()), true);
226+
if(worksheet.selectedCell) {
227+
worksheet.insertColumn(parseInt(inputAddQuantity.value), getMinPosition(worksheet.getSelectedColumns()), true);
228+
}
220229
} else {
221230
worksheet.goto(getMinPosition(worksheet.getSelectedRows(true)),0);
222231
worksheet.insertColumn(parseInt(inputAddQuantity.value), 0, true);
@@ -406,6 +415,9 @@
406415
return spreadsheet.worksheets[0];
407416
}
408417

418+
/**
419+
* get max position
420+
*/
409421
function getMaxPosition(values) {
410422
if(typeof values == "object" && !Array.isArray(values)) {
411423
values = Object.values(values);
@@ -423,6 +435,9 @@
423435
}
424436
}
425437

438+
/**
439+
* get min position
440+
*/
426441
function getMinPosition(values) {
427442
if(typeof values == "object" && !Array.isArray(values)) {
428443
values = Object.values(values);

plugins/JSSV8/src/statusbar/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@
2828
"jspreadsheet": ">9.0.0"
2929
},
3030
"main": "index.js",
31-
"version": "2.3.5"
31+
"version": "2.3.6"
3232
}

plugins/JSSV8/src/statusbar/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Plugin CSS status bar for Jspreadsheet Pro
33
*
4-
* @version 2.3.5
4+
* @version 2.3.6
55
* @author Guillaume Bonnaire <contact@gbonnaire.fr>
66
* @website https://repo.gbonnaire.fr
77
*

0 commit comments

Comments
 (0)