[wp-trac] [WordPress Trac] #26183: Calling quicktags *after* initial setup results in an empty toolbar

WordPress Trac noreply at wordpress.org
Sat Nov 23 22:32:44 UTC 2013


#26183: Calling quicktags *after* initial setup results in an empty toolbar
--------------------------+-----------------------------
 Reporter:  PeterRKnight  |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Editor        |    Version:  3.7.1
 Severity:  minor         |   Keywords:
--------------------------+-----------------------------
 Quicktags.js has a limitation in that if you call quicktags on a textarea
 after it has been previously been initialized it fails to attach buttons.

 To reproduce this bug, go to a post editing page and bring up the console
 and attempt to call quicktags on a textarea, like:

 {{{
 quicktags({id:"metavalue", buttons: "strong,link,em"});
 }}}

 The expected result is a quicktags toolbar with buttons, instead you get
 an empty toolbar. This is because of the following lines:


 {{{
 if ( !qt.instances[0] ) {
                         qt.instances[0] = qt.instances[id];
                         _domReady( function(){ qt._buttonsInit(); } );
                 }
 }}}

 Because qt.instances[0] has been set, it fails to continue on to rendering
 the buttons on a new textarea.

 This strikes me as a bug, or at least an unnecessary limitation. I
 stumbled against this when trying to add a quicktag enabled textarea
 dynamically.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/26183>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list