[wp-trac] [WordPress Trac] #30236: Trigger widget-added event in Customizer when initializing

WordPress Trac noreply at wordpress.org
Mon Nov 3 22:17:29 UTC 2014


#30236: Trigger widget-added event in Customizer when initializing
--------------------------+-------------------------
 Reporter:  westonruter   |       Owner:  ocean90
     Type:  defect (bug)  |      Status:  reviewing
 Priority:  normal        |   Milestone:  4.1
Component:  Customize     |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  javascript
--------------------------+-------------------------

Comment (by ocean90):

 I added

 {{{
 $( document ).on( 'widget-added', function(event, widget) {
         console.log(widget);
 });
 }}}

 before the .trigger() line and got this with 4 widgets:

 {{{
 [div#widget-15_search-3.widget, prevObject: jQuery.fn.init[1], context:
 undefined, selector: ".widget:first", jquery: "1.11.1", constructor:
 function…] customize-widgets.js?ver=4.1-alpha-30000-src:437
 [div#widget-16_color-picker-3.widget, prevObject: jQuery.fn.init[1],
 context: undefined, selector: ".widget:first", jquery: "1.11.1",
 constructor: function…] customize-widgets.js?ver=4.1-alpha-30000-src:437
 [div#widget-16_color-picker-3.widget, prevObject: jQuery.fn.init[1],
 context: undefined, selector: ".widget:first", jquery: "1.11.1",
 constructor: function…] customize-widgets.js?ver=4.1-alpha-30000-src:437
 [div#widget-17_pages-2.widget, prevObject: jQuery.fn.init[1], context:
 undefined, selector: ".widget:first", jquery: "1.11.1", constructor:
 function…] customize-widgets.js?ver=4.1-alpha-30000-src:437
 [div#widget-17_pages-2.widget, prevObject: jQuery.fn.init[1], context:
 undefined, selector: ".widget:first", jquery: "1.11.1", constructor:
 function…] customize-widgets.js?ver=4.1-alpha-30000-src:437
 [div#widget-17_pages-2.widget, prevObject: jQuery.fn.init[1], context:
 undefined, selector: ".widget:first", jquery: "1.11.1", constructor:
 function…] customize-widgets.js?ver=4.1-alpha-30000-src:437
 [div#widget-18_rss-2.widget, prevObject: jQuery.fn.init[1], context:
 undefined, selector: ".widget:first", jquery: "1.11.1", constructor:
 function…] customize-widgets.js?ver=4.1-alpha-30000-src:437
 [div#widget-18_rss-2.widget, prevObject: jQuery.fn.init[1], context:
 undefined, selector: ".widget:first", jquery: "1.11.1", constructor:
 function…] customize-widgets.js?ver=4.1-alpha-30000-src:437
 [div#widget-18_rss-2.widget, prevObject: jQuery.fn.init[1], context:
 undefined, selector: ".widget:first", jquery: "1.11.1", constructor:
 function…] customize-widgets.js?ver=4.1-alpha-30000-src:437
 [div#widget-18_rss-2.widget, prevObject: jQuery.fn.init[1], context:
 undefined, selector: ".widget:first", jquery: "1.11.1", constructor:
 function…] customize-widgets.js?ver=4.1-alpha-30000-src:437
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30236#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list