[wp-trac] [WordPress Trac] #23293: wpColorPicker not working in widgets. Jquery .live() needed.

WordPress Trac noreply at wordpress.org
Fri Jan 25 16:31:09 UTC 2013


#23293: wpColorPicker not working in widgets. Jquery .live() needed.
-------------------------------------------------+-------------------------
 Reporter:  johnstonphilip                       |       Type:  defect
   Status:  new                                  |  (bug)
Milestone:  Awaiting Review                      |   Priority:  normal
  Version:  3.5                                  |  Component:  General
 Keywords:  2nd-opinion needs-patch dev-         |   Severity:  normal
  feedback                                       |
-------------------------------------------------+-------------------------
 This should be a simple fix. I was creating a widget that uses the new
 color picker in WordPress 3.5.

 It works fine except for when it is first added to a sidebar. I suspect
 this is because the widget is being added to the sidebar by jquery. The
 color picker is also applied using jquery - but it isn't able to select
 the color element because it wasn't part of the DOM when the page loaded.

 I don't know where the js code is for the wpColorPicker javascript
 function, but somewhere in there this should likely be added:
 http://api.jquery.com/live/

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


More information about the wp-trac mailing list