Created
October 28, 2014 20:33
-
-
Save kramapet/d57b812ab7514885399e to your computer and use it in GitHub Desktop.
Destroy instance of WYMeditor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* destroy instance of wymeditor: | |
* - updates content between iframe and textarea | |
* - remove iframe | |
* - show textarea | |
* - replace element with undefined (to trick jQuery.getWymeditorByTextarea(el)) | |
* @see https://github.com/wymeditor/wymeditor/blob/master/src/wymeditor/core.js#L520 | |
* @param {WYMeditor.editor} instance | |
*/ | |
var wymeditor_destroy = function (instance) { | |
instance.update(); | |
instance._box.remove(); | |
instance._element.show(); | |
instance._element[0] = undefined; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment