Skip to content

Commit

Permalink
fix for #130 mathtype plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
w8tcha committed Sep 27, 2020
1 parent 8579b09 commit 8c7f689
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions autosave/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,16 @@

CKEDITOR.tools.array.forEach(CKEDITOR.document.find(config.saveDetectionSelectors).toArray(), function(el) {
el.$.addEventListener("click", function () {
RemoveStorage(config.SaveKey, editorInstance);
RemoveStorage(config.SaveKey, editorInstance);
});
});

editorInstance.on("change", function() {
startTimer(config, editorInstance);
startTimer(config, editorInstance);
});

editorInstance.on("blur", function() {
startTimer(config, editorInstance);
});

editorInstance.on("destroy", function() {
Expand Down Expand Up @@ -278,8 +282,8 @@
var compressedJSON = LZString.compressToUTF16(JSON.stringify({ data: editorInstance.getData(), saveTime: new Date() }));

var quotaExceeded = false;

try {
try {
localStorage.setItem(autoSaveKey, compressedJSON);
} catch (e) {
quotaExceeded = isQuotaExceeded(e);
Expand All @@ -297,8 +301,8 @@
if (editorInstance.plugins.wordcount && messageType == "statusbar" && editorInstance.container.$.clientWidth < 150) {
messageType = "notification";
}

if (messageType == "statusbar") {
if (messageType == "statusbar") {
var autoSaveMessage = document.getElementById(autoSaveMessageId(editorInstance));

if (autoSaveMessage) {
Expand Down

0 comments on commit 8c7f689

Please sign in to comment.