[wp-trac] [WordPress Trac] #26183: Calling quicktags *after* initial setup results in an empty toolbar
WordPress Trac
noreply at wordpress.org
Mon Mar 31 13:08:23 UTC 2014
#26183: Calling quicktags *after* initial setup results in an empty toolbar
--------------------------+-----------------------------
Reporter: PeterRKnight | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Editor | Version: 3.7.1
Severity: minor | Resolution:
Keywords: | Focuses:
--------------------------+-----------------------------
Comment (by helgatheviking):
I've had this problem for years!
[http://wordpress.stackexchange.com/questions/44993/use-quicktags-toolbar-
on-any-textarea] I wasn't able to track it down or I might've reported
it... instead I just thought I was going crazy.
Now that I've come back to my problem code, I've found a very similar
issue with the
{{{
if ( tinyMCEPreInit.mceInit[ id ] && tinyMCEPreInit.mceInit[ id ].wpautop
) {
txtarea_el.value = t.wpautop( txtarea_el.value );
}
}}}
in `switchEditors()`. I've gotten around it by using javascript to add my
settings for my dynamically added textarea to the tinyMCEPreInit.mceInit
object.
{{{
// my_settings can be whatever, but I've cloned them from the #content's
settings
var settings = $.extend( {}, my_settings, { selector : "#" + id } );
// add our copy to the collection in the tinyMCEPreInit object because
switch editors
tinyMCEPreInit.mceInit[id] = settings;
}}}
So if the quicktags did at least the same as the tinymce `if (
tinyMCEPreInit.mceInit[ id ] )` we could hack our way around it.
If there is an `add_Instance(settings)` added for quicktags, it'd be great
to have that added to tinyMCE as well!
Changing the offending code to this actually seems to resolve it for me
(assuming a similar hackish way of adding to the qtInit property):
{{{
if ( qt.instances[id] ) {
_domReady( function(){ qt._buttonsInit(); } );
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/26183#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list