[wp-trac] [WordPress Trac] #19587: WordPress widget admin bug

WordPress Trac wp-trac at lists.automattic.com
Sat Dec 17 16:38:58 UTC 2011


#19587: WordPress widget admin bug
-------------------------------+------------------------------
 Reporter:  ciprian_vb         |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Widgets            |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |
-------------------------------+------------------------------

Comment (by scribu):

 Here's some JS code I use in a widget that works fine:

 {{{
 add_action( 'admin_footer', 'my_widget_script' );

 function my_widget_script() {
 ?>
 <script type="text/javascript">
 jQuery(function($){
         $(document).delegate('.qmt-taxonomies', 'mouseenter', function(ev)
 {
                 $(this).sortable();
                 $(this).disableSelection();
         });
 });
 </script>
 <?php
 }
 }}}

 Note that naively calling {{{$('.qmt-taxonomies').sortable()}}} will not
 work when a new widget is created, because that DOM element simply doesn't
 exist yet when the JS is loaded.

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


More information about the wp-trac mailing list