Index: trunk/extensions/Narayam/resources/ext.narayam.core.js |
— | — | @@ -558,11 +558,6 @@ |
559 | 559 | return null; |
560 | 560 | } |
561 | 561 | |
562 | | - // Event listener for scheme selection. |
563 | | - $( '.narayam-scheme', $( '#narayam-menu-items > ul')[0] ).live( 'click', function() { |
564 | | - that.setScheme( $( this ).val() ); |
565 | | - } ); |
566 | | - |
567 | 562 | // Build enable/disable checkbox and label |
568 | 563 | var $checkbox = $( '<input type="checkbox" id="narayam-toggle" />' ); |
569 | 564 | $checkbox |
— | — | @@ -607,16 +602,17 @@ |
608 | 603 | } |
609 | 604 | |
610 | 605 | // Event listener for scheme selection - dynamic loading of rules. |
611 | | - $( '.narayam-scheme', $('.narayam-scheme-dynamic-item') ).live( 'click', function() { |
| 606 | + $narayamMenuItems.delegate( 'input:radio', 'click', function( ) { |
612 | 607 | that.setScheme( $( this ).val() ); |
613 | | - // rebuild the menu items with recent items. |
614 | | - $( '#narayam-menu' ).html( $.narayam.buildMenuItems() ); |
615 | | - $( '#narayam-menu-items' ).css( 'left', $('li#pt-narayam').offset().left ); |
616 | | - $( '#narayam-' + $( this ).val() ).prop( 'checked', true ); |
617 | | - if ( enabled ) { |
618 | | - $( '#narayam-toggle' ).prop( 'checked', true ); |
| 608 | + if ( $( this ).parent().hasClass( 'narayam-scheme-dynamic-item' ) ){ |
| 609 | + // rebuild the menu items with recent items. |
| 610 | + $( '#narayam-menu' ).html( $.narayam.buildMenuItems() ); |
| 611 | + $( '#narayam-menu-items' ).css( 'left', $( 'li#pt-narayam' ).offset().left ); |
| 612 | + $( '#narayam-' + $( this ).val() ).prop( 'checked', true ); |
| 613 | + if ( enabled ) { |
| 614 | + $( '#narayam-toggle' ).prop( 'checked', true ); |
| 615 | + } |
619 | 616 | } |
620 | | - event.stopPropagation(); |
621 | 617 | } ); |
622 | 618 | |
623 | 619 | var helppage = mw.config.get( 'wgNarayamHelpPage' ); |
— | — | @@ -700,7 +696,9 @@ |
701 | 697 | $menu.removeClass( 'open' ); |
702 | 698 | $menu.hide(); |
703 | 699 | } ); |
704 | | - |
| 700 | + $menu.click( function( event ) { |
| 701 | + event.stopPropagation(); |
| 702 | + } ); |
705 | 703 | // Workaround for IE bug - activex components like input fields |
706 | 704 | // coming on top of everything. |
707 | 705 | // TODO: is there a better solution other than hiding it on hover? |