From 4a6b91c6cbdca167450061676ce2576f8ae6dcac Mon Sep 17 00:00:00 2001 From: Lincoln Phillips <243786C@curtin.edu.au> Date: Fri, 10 Nov 2017 10:27:41 +0800 Subject: [PATCH 1/2] Fix Issue #89 Maybe Fix Issue #93 --- lib/csv-editor-element.js | 7 ++++++- lib/table-element.js | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/csv-editor-element.js b/lib/csv-editor-element.js index c99ced0..f3e8352 100644 --- a/lib/csv-editor-element.js +++ b/lib/csv-editor-element.js @@ -102,7 +102,12 @@ class CSVEditorElement extends HTMLElement { requestAnimationFrame(() => { this.updatePreview(this.collectOptions()) - this.model.applyChoice() + //Fix Issue #89 Uncaught TypeError: Cannot read property 'applyChoice' of undefined + try { + this.model.applyChoice() + } catch (e) { + this.destroy() + } }) } diff --git a/lib/table-element.js b/lib/table-element.js index 81b9bee..516b1b6 100644 --- a/lib/table-element.js +++ b/lib/table-element.js @@ -1306,8 +1306,9 @@ class TableElement extends HTMLElement { const cursorValue = cursor.getValue() this.editor.setText(String(cursorValue || this.getUndefinedDisplay())) - this.editor.getBuffer().history.clearUndoStack() - this.editor.getBuffer().history.clearRedoStack() + //Removed - Issue #93 (Uncaught TypeError: Cannot read property 'clearUndoStack' of undefined) + //this.editor.getBuffer().history.clearUndoStack() + //this.editor.getBuffer().history.clearRedoStack() if (initialData) { this.editor.setText(initialData) } } From 1d314b5bcea8ff8b6ea38baa083e442b2c7782e0 Mon Sep 17 00:00:00 2001 From: Lincoln Phillips <243786C@curtin.edu.au> Date: Mon, 13 Nov 2017 08:46:20 +0800 Subject: [PATCH 2/2] Fix Travis CI Build error --- lib/csv-editor-element.js | 2 +- lib/table-element.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/csv-editor-element.js b/lib/csv-editor-element.js index f3e8352..429fe3d 100644 --- a/lib/csv-editor-element.js +++ b/lib/csv-editor-element.js @@ -102,7 +102,7 @@ class CSVEditorElement extends HTMLElement { requestAnimationFrame(() => { this.updatePreview(this.collectOptions()) - //Fix Issue #89 Uncaught TypeError: Cannot read property 'applyChoice' of undefined + // Fix Issue #89 Uncaught TypeError: Cannot read property 'applyChoice' of undefined try { this.model.applyChoice() } catch (e) { diff --git a/lib/table-element.js b/lib/table-element.js index 516b1b6..4ca1f9a 100644 --- a/lib/table-element.js +++ b/lib/table-element.js @@ -1306,9 +1306,9 @@ class TableElement extends HTMLElement { const cursorValue = cursor.getValue() this.editor.setText(String(cursorValue || this.getUndefinedDisplay())) - //Removed - Issue #93 (Uncaught TypeError: Cannot read property 'clearUndoStack' of undefined) - //this.editor.getBuffer().history.clearUndoStack() - //this.editor.getBuffer().history.clearRedoStack() + // Removed - Issue #93 (Uncaught TypeError: Cannot read property 'clearUndoStack' of undefined) + // this.editor.getBuffer().history.clearUndoStack() + // this.editor.getBuffer().history.clearRedoStack() if (initialData) { this.editor.setText(initialData) } }