To participate you must create an account on apostrophenow.org. If you have already done so, click Login.
Changeset 2162
- Timestamp:
- 09/09/10 11:10:04 (17 months ago)
- Author:
- johnnyoffline
- Message:
-
added a classname to the menu container
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r2160
|
r2162
|
|
| 650 | 650 | if (typeof overlay != "undefined" && overlay) { overlay = $('.a-page-overlay'); } /* optional full overlay */ |
| 651 | 651 | var menu = $(button).parent(); // Use the parent of the button as the menu container |
| 652 | | |
| | 652 | |
| | 653 | // We need an ID for the menu. If the menu doesn't have one, we create it by appending 'menu' to the Button ID |
| 653 | 654 | if (menu.attr('id') == '') { |
| 654 | | // We need an ID for the menu. If the menu doesn't have one, we create it by appending 'menu' to the Button ID |
| 655 | 655 | newID = button.attr('id')+'-menu'; |
| 656 | | menu.attr('id', newID); |
| 657 | | } |
| 658 | | |
| 659 | | button.unbind('click').click(function() |
| 660 | | { |
| 661 | | // Button Toggle |
| | 656 | menu.attr('id', newID).addClass('a-options-container'); |
| | 657 | } |
| | 658 | |
| | 659 | // Button Toggle |
| | 660 | button.unbind('click').click(function(){ |
| 662 | 661 | if (!button.hasClass('aActiveMenu')) |
| 663 | 662 | { |
| … |
… |
|
| 670 | 669 | }); |
| 671 | 670 | |
| | 671 | // Open Menu, Create Listener |
| 672 | 672 | menu.bind('toggleOpen', function(){ |
| 673 | | // Open Menu, Create Listener |
| 674 | 673 | button.addClass('aActiveMenu'); |
| 675 | 674 | menu.addClass(classname); |
| 676 | 675 | if (overlay) { overlay.stop().show(); } |
| 677 | 676 | $(document).click(function(e){ |
| 678 | | var target = e.target; |
| 679 | | target = $(target); |
| 680 | | if (target.hasClass('.a-page-overlay') || target.hasClass('.a-cancel')) { |
| | 677 | var target = $(e.target); |
| | 678 | if (target.hasClass('.a-page-overlay') || target.hasClass('.a-cancel')) |
| | 679 | { |
| 681 | 680 | menu.trigger('toggleClosed'); |
| 682 | 681 | } |
| 683 | | if (!target.parents().is('#'+menu.attr('id'))) { |
| | 682 | if ( !target.parents().is('#'+menu.attr('id')) ) |
| | 683 | { |
| 684 | 684 | menu.trigger('toggleClosed'); |
| 685 | 685 | } |
Download in other formats: