Opened 14 years ago
Closed 14 years ago
#7509 closed Bug (invalid)
CKEDITOR.currentInstance is null inside a plugin
Reported by: | Dan Silk | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | UI : Toolbar | Version: | 3.5.2 |
Keywords: | Cc: | emeerson@…, rbudigelli@… |
Description
I have a page with 2 instances of CKEditor and I'm using the MediaEmbed (http://www.fluidbyte.net/embed-youtube-vimeo-etc-into-ckeditor) plugin to add video to the content. I add the MediaEmbed button to the tool bar of the first instance only, but when trying to add media to the content, it gets inserted in the second instance. Debugging reveals that inside the plugin the "editor" variable which is passed to the plugin is the wrong (second) instance and the "currentInstance" property of the CKEDITOR object is null.
Change History (1)
comment:1 Changed 14 years ago by
Keywords: | currentInstance plugin MediaEmbed removed |
---|---|
Resolution: | → invalid |
Status: | new → closed |
I think I may have found the root of your problem. You didn't pass editor instance to dialog function. After changing your code from:
to:[BR]
it started working as it should. Although I had to clear my browser's cache to see changes.
If I could give you a piece of advice: I have noticed one annoying thing in your plug-in. I have pasted one youtube link and than I wanted to paste another but when I opened the dialog window there was still an old link. I had to delete it first and than I could paste another. It’s no big deal but I thought to myself – if I had to paste ten or twenty youtube links like this (every time with extra delete) I would be pretty angry at the end ;).