Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#32873 closed defect (bug) (fixed)

Remove additional toolbar html when editor instance is removed

Reported by: ungestaltbar Owned by: iseulde
Priority: normal Milestone: 4.3
Component: Editor Version: 4.1
Severity: normal Keywords: has-patch
Cc: Focuses: javascript

Description

Whenever a tinymce instance is (dynamically) created, the tinymce plugins
/wpeditimage/plugin.js
/wordpress/plugin.js
insert necessary toolbar markup to the document.

This markup is not removed from the DOM when removing an editor instance by calling (for example)

tinyMCE.execCommand('mceRemoveEditor', true, editor_id);

I've attached a rough patch to demonstrate how removal could work and a screenshot of the problem. I didn't find a native method to do this in the tinymce documentation.

Attachments (2)

tinymce_toolbar_markup.png (61.5 KB ) - added by ungestaltbar 11 years ago.
Screenshot of toolbar markup after removing the instance
plugin.diff (494 bytes ) - added by ungestaltbar 11 years ago.
example patch for wpeditimage/plugin.js

Download all attachments as: .zip

Change History (6)

@ungestaltbar
11 years ago

Screenshot of toolbar markup after removing the instance

@ungestaltbar
11 years ago

example patch for wpeditimage/plugin.js

#1 @iseulde
11 years ago

  • Keywords has-patch added
  • Milestone Awaiting Review4.3
  • Version trunk4.1

Good catch and thanks for the patch!

#2 @iseulde
11 years ago

  • Owner set to iseulde
  • Resolutionfixed
  • Status newclosed

In 33294:

TinyMCE: inline toolbar: fix memory leaks

Part props ungestaltbar.
Fixes #32873.

#3 @ungestaltbar
11 years ago

Thanks @iseulde !

Similiar situation in wpeditimage

https://core.trac.wordpress.org/browser/trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js

or does your fix take care of the editimage toolbar as well ( looks like it inherits from the toolbar factory )?

#4 @iseulde
11 years ago

This will take care of all inline toolbars. :)

Note: See TracTickets for help on using tickets.