EDIT: Stop duplication of plugin
I'm using a plugin for a WYSIWYG editor inside of a jQuery UI dialog form and I need to remove it after it gets used so I can re-use it later...
There is a function in the plugin code for removing it, but I can't figure out how to call it. Here is the code for the function to remove:
- * Removes the HtmlBox instance from the DOM and the globalspace
*/
this.remove = function(){
global_hb[d.id]=undefined;
$("#"+d.id+"_wrap").remove();
if ($("#"+d.id+"_about").length === 0){$("#"+d.id+"_about").remove();}
};
Here is the code snippet where I initialize the plugin and then where I would like to remove it, but that part isn't working. I initialize it on opening a jqueryui dialog box, so it seems I should remove it when I close it... without doing anything, it gets duplicated each time I open the dialog.
- open: function(event, ui) {
var htmb=$("#desc").htmlbox({
buttons:[
["bold","italic","underline"]
],
icons:"default",
skin:"green",
about:false
})
},
close: function(event){
remove($("#desc").htmlbox());
}