You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: spreadsheet not updating when switching from and to a black spreadsheet (#54)
* fix: update dev cycle
* chore: lint files
* fix: spreadsheet not updating when switching from and to a black spreadsheet
* chore: build
* chore: increment version
* chore: increment version
Co-authored-by: Johnny Almonte <[email protected]>
Copy file name to clipboardExpand all lines: app/components/Home.js
+43-32Lines changed: 43 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -17,28 +17,28 @@ export default class Home extends React.Component {
17
17
18
18
componentDidMount(){
19
19
$(function(){
20
-
$("#spreadsheet").kendoSpreadsheet({
20
+
$('#spreadsheet').kendoSpreadsheet({
21
21
rows: this.numRows,
22
22
columns: this.numColumns,
23
23
change: this.onChange,
24
24
changeFormat: this.onChange,// triggered when cell structure changes (currency, date, etc)
25
25
excelImport: (event)=>{
26
26
// Excel import functionality has been disabled completely.
27
27
// We'll keep this code around below incase we enable it again in the future.
28
-
if(!confirm("Importing will completely overwrite any existing data. Are you sure you want to continue?")){
28
+
if(!confirm('Importing will completely overwrite any existing data. Are you sure you want to continue?')){
29
29
event.preventDefault();
30
30
return;
31
31
}
32
32
33
-
if(!confirm("Note that importing from Excel may cause very large file sizes within Standard Notes, which may affect performance. You may continue with import, but if you notice performance issues, it is recommended you manually import data instead.")){
33
+
if(!confirm('Note that importing from Excel may cause very large file sizes within Standard Notes, which may affect performance. You may continue with import, but if you notice performance issues, it is recommended you manually import data instead.')){
34
34
event.preventDefault();
35
35
return;
36
36
}
37
37
38
38
event.promise.done(()=>{
39
-
console.log("Import complete");
39
+
console.log('Import complete');
40
40
this.onChange();
41
-
})
41
+
});
42
42
43
43
},
44
44
insertSheet: this.onChange,
@@ -50,12 +50,12 @@ export default class Home extends React.Component {
50
50
hideRow: this.onChange,
51
51
deleteColumn: this.onChange,
52
52
deleteRow: this.onChange,
53
-
insertColumn: (event)=>{
53
+
insertColumn: (_event)=>{
54
54
this.numColumns++;
55
55
this.sheetSizeUpdated=true;
56
56
this.onChange();
57
57
},
58
-
insertRow: (event)=>{
58
+
insertRow: ()=>{
59
59
this.numRows++;
60
60
this.sheetSizeUpdated=true;
61
61
this.onChange();
@@ -77,23 +77,23 @@ export default class Home extends React.Component {
77
77
78
78
this.reloadSpreadsheetContent();
79
79
80
-
$(".k-item, .k-button").click((e)=>{
80
+
$('.k-item, .k-button').click(()=>{
81
81
setTimeout(()=>{
82
82
this.onChange();
83
83
},10);
84
84
});
85
85
86
86
// remove import option
87
-
$(".k-upload-button").remove();
87
+
$('.k-upload-button').remove();
88
88
}.bind(this));
89
89
}
90
90
91
91
getSpreadsheet(){
92
-
return$("#spreadsheet").getKendoSpreadsheet();
92
+
return$('#spreadsheet').getKendoSpreadsheet();
93
93
}
94
94
95
-
onChange=(event)=>{
96
-
if(!this.note){
95
+
onChange=()=>{
96
+
if(!this.note){
97
97
return;
98
98
}
99
99
@@ -108,33 +108,32 @@ export default class Home extends React.Component {
0 commit comments