From 4baded7c9c831880a3d4a1fad3d5cd3217a35f5a Mon Sep 17 00:00:00 2001 From: Andrew Walker Date: Wed, 30 Dec 2015 12:18:31 -0600 Subject: [PATCH 1/2] Added ability for a callback on update of Editor content - as well as resetting the initial "textarea" that is hidden --- editor.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/editor.js b/editor.js index bb4da07..9b575d9 100644 --- a/editor.js +++ b/editor.js @@ -1033,6 +1033,10 @@ You should have received a copy of the GNU General Public License along with thi }); } + editor.on('keyup', function (event) { + $this.val(methods.getText.apply(editor_Content)); + if (typeof options.changeCallback !== 'undefined') options.changeCallback($this.val()); + }); for(var item in menuItems){ if(!settings[item] ){ //if the display is not set to true for the button in the settings. From a1c6f4c87bf199ee47a2b83cc2a71852f7d44936 Mon Sep 17 00:00:00 2001 From: Andrew Walker Date: Wed, 30 Dec 2015 15:36:58 -0600 Subject: [PATCH 2/2] Fixed Issue w/ adding links and fast typing updating --- editor.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/editor.js b/editor.js index 9b575d9..7a5f41c 100644 --- a/editor.js +++ b/editor.js @@ -1005,7 +1005,7 @@ You should have received a copy of the GNU General Public License along with thi 'togglescreen':true },options); - var containerDiv = $("
",{ class : "row-fluid Editor-container" }); + var containerDiv = $("
",{ class : "row-fluid Editor-container", tabindex : "0" }); var $this = $(this).hide(); $this.after(containerDiv); @@ -1031,13 +1031,17 @@ You should have received a copy of the GNU General Public License along with thi $(editor_Content).data("statusBar").html('
'+'Words : '+wordCount+'
'); $(editor_Content).data("statusBar").append('
'+'Characters : '+charCount+'
'); }); - } - - editor.on('keyup', function (event) { + } + + containerDiv.on("blur", function (event) { + console.log(typeof editorObj, editorObj); $this.val(methods.getText.apply(editor_Content)); if (typeof options.changeCallback !== 'undefined') options.changeCallback($this.val()); - }); - + $(editorObj).data("editor").focus(); + + }); + + for(var item in menuItems){ if(!settings[item] ){ //if the display is not set to true for the button in the settings. if(settings[item] in menuGroups){