[wp-trac] [WordPress Trac] #23293: wpColorPicker not working in widgets

WordPress Trac noreply at wordpress.org
Fri Jan 25 21:34:28 UTC 2013


#23293: wpColorPicker not working in widgets
----------------------------+------------------------------
 Reporter:  johnstonphilip  |       Owner:
     Type:  defect (bug)    |      Status:  closed
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Widgets         |     Version:  3.5
 Severity:  normal          |  Resolution:  invalid
 Keywords:  needs-patch     |
----------------------------+------------------------------
Changes (by mattwiebe):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 This is an implementation issue, not a `wpColorPicker` issue. It's not
 magic, it has to be called on the right element at the right time. You
 could:

 1. Put a `script` element inline inside the widget's `widget` method,
 referencing some unique id that you give the text `input` that you want to
 turn into a `wpColorPicker` instance. A bit ugly, but it'll work.
 2. If inline code makes you twitch, the cleaner version would go something
 like:

 {{{
 jQuery('#widgets-right .widgets-sortables').on('sortstop',
 function(event,ui){
     // run js after widgets are dropped. ui.item contains the dropped
 item.
     // note that the dropped item could just as easily be a reordering
 rather
     // than a new widget. Plan your logic accordingly.
 });
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23293#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list