Index: trunk/extensions/Narayam/resources/ext.narayam.core.css |
— | — | @@ -15,8 +15,12 @@ |
16 | 16 | div#narayam-menu { |
17 | 17 | direction: ltr; |
18 | 18 | float: left; |
| 19 | + display: none; |
19 | 20 | } |
20 | 21 | |
| 22 | +div#narayam-menu.open { |
| 23 | + display: block; |
| 24 | +} |
21 | 25 | /* @noflip */ |
22 | 26 | body.rtl div#narayam-menu { |
23 | 27 | direction: rtl; |
Index: trunk/extensions/Narayam/resources/ext.narayam.core.js |
— | — | @@ -578,13 +578,14 @@ |
579 | 579 | var $moreLink = $( '<a>' ) |
580 | 580 | .text( mw.msg( 'narayam-more-imes' ) ) |
581 | 581 | .prop( 'href', '#' ) |
582 | | - .click( function() { |
| 582 | + .click( function( event ) { |
583 | 583 | $('.narayam-scheme-dynamic-item').toggle( 'fast' ); |
584 | 584 | if ( $('li.narayam-more-imes-link').hasClass( 'open' ) ) { |
585 | 585 | $('li.narayam-more-imes-link').removeClass( 'open' ); |
586 | 586 | } else { |
587 | 587 | $('li.narayam-more-imes-link').addClass( 'open' ); |
588 | 588 | } |
| 589 | + event.stopPropagation(); |
589 | 590 | } ); |
590 | 591 | |
591 | 592 | $narayamMenuItems.append( $( '<li>' ) |
— | — | @@ -615,6 +616,7 @@ |
616 | 617 | if ( enabled ) { |
617 | 618 | $( '#narayam-toggle' ).prop( 'checked', true ); |
618 | 619 | } |
| 620 | + event.stopPropagation(); |
619 | 621 | } ); |
620 | 622 | |
621 | 623 | var helppage = mw.config.get( 'wgNarayamHelpPage' ); |
— | — | @@ -658,14 +660,22 @@ |
659 | 661 | $( '#p-personal ul:first' )[fn]( $li ); |
660 | 662 | $( 'body' ).prepend( $menu ); |
661 | 663 | $menu.hide(); |
662 | | - $li.hover( function() { |
| 664 | + $li.click( function( event ) { |
663 | 665 | $menuItemsDiv.css( 'left', $li.offset().left ); |
664 | | - $menu.show(); |
665 | | - }); |
666 | | - $menu.hover( function() { |
667 | | - }, function() { |
| 666 | + if( $menu.hasClass( 'open' ) ){ |
| 667 | + $menu.removeClass( 'open' ); |
| 668 | + $menu.hide(); |
| 669 | + } else { |
| 670 | + $( 'div.open' ).removeClass( 'open' ); |
| 671 | + $menu.addClass( 'open' ); |
| 672 | + $menu.show(); |
| 673 | + event.stopPropagation(); |
| 674 | + } |
| 675 | + } ); |
| 676 | + $( 'html' ).click( function() { |
| 677 | + $menu.removeClass( 'open' ); |
668 | 678 | $menu.hide(); |
669 | | - }); |
| 679 | + } ); |
670 | 680 | |
671 | 681 | // Workaround for IE bug - activex components like input fields |
672 | 682 | // coming on top of everything. |