WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#32873 closed defect (bug) (fixed)

Remove additional toolbar html when editor instance is removed

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

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 4 years ago.
Screenshot of toolbar markup after removing the instance
plugin.diff (494 bytes) - added by ungestaltbar 4 years ago.
example patch for wpeditimage/plugin.js

Download all attachments as: .zip

Change History (6)

@ungestaltbar
4 years ago

Screenshot of toolbar markup after removing the instance

@ungestaltbar
4 years ago

example patch for wpeditimage/plugin.js

#1 @iseulde
4 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 4.3
  • Version changed from trunk to 4.1

Good catch and thanks for the patch!

#2 @iseulde
4 years ago

  • Owner set to iseulde
  • Resolution set to fixed
  • Status changed from new to closed

In 33294:

TinyMCE: inline toolbar: fix memory leaks

Part props ungestaltbar.
Fixes #32873.

#3 @ungestaltbar
4 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
4 years ago

This will take care of all inline toolbars. :)

Note: See TracTickets for help on using tickets.