Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed removeInstance bug: r is an instance of nicEditorInstance( or n…

…icEditorIFrameInstance), it doesn't have the removeInstance and removePanel methods
  • Loading branch information...
commit eb2a83364dca35b637982546539bdca9865f9cb6 1 parent efa6a1e
Danish Khan authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  nicEdit.js
View
2  nicEdit.js
@@ -296,7 +296,7 @@ var nicEditors = {
var editors = nicEditors.editors;
for(var i=0;i<editors.length;i++) {
if(editors[i].instanceById(e)) {
- return editors[i].instanceById(e);
+ return editors[i]; // r is an instance of nicEditorInstance therefore it does not have removeInstance or removePanel methods
}
}
}

4 comments on commit eb2a833

@nebulous

This breaks niceEditors.findEditor('someTextAreaID') which is the documented way to get a specific instance. Perhaps it was intended to go elsewhere?

@danishkhan
Owner

Interesting I didn't run into that issues. So you are saying that it should be reverted and that using the editors[i].instanceById(e) will have removeInstance and removePanel?

@nebulous

Perhaps there's a conflict here: I needed access to getContent() which is only available from the instance as returned by editors[i].instanceById(e) but remove(Instance|Panel) are only available by using editors[i]

upon cursory review it appears to be the difference between a nicEditorInstance and nicEditor (where according to the original documentation it would seem that a nicEditorInstance is what is expected to be returned)

@victorbstan

Running into the same problem... update: two ways to get at the editor, save an instance in a variable when you initialize it and second, use the findEditor function.

Please sign in to comment.
Something went wrong with that request. Please try again.