Merge pull request #3998 from rockandror/ckeditor-browser-history-back
Destroy and intialize ckeditor on browser history back
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
$(document).on("page:change", function() {
|
||||
if (typeof(CKEDITOR) != "undefined"){
|
||||
for(name in CKEDITOR.instances){
|
||||
try{CKEDITOR.replace(name);}catch(err){};
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1,6 +1,11 @@
|
||||
(function() {
|
||||
"use strict";
|
||||
App.HTMLEditor = {
|
||||
destroy: function() {
|
||||
for (var name in CKEDITOR.instances) {
|
||||
CKEDITOR.instances[name].destroy();
|
||||
}
|
||||
},
|
||||
initialize: function() {
|
||||
$("textarea.html-area").each(function() {
|
||||
if ($(this).hasClass("admin")) {
|
||||
@@ -11,4 +16,7 @@
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(document).on("page:before-unload", App.HTMLEditor.destroy);
|
||||
$(document).on("page:restore", App.HTMLEditor.initialize);
|
||||
}).call(this);
|
||||
|
||||
Reference in New Issue
Block a user