To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Changeset 2162

Show
Ignore:
Timestamp:
09/09/10 11:10:04 (17 months ago)
Author:
johnnyoffline
Message:

added a classname to the menu container

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • plugins/apostrophePlugin/trunk/web/js/a.js

    r2160 r2162  
    650650                if (typeof overlay != "undefined" && overlay) { overlay = $('.a-page-overlay'); } /* optional full overlay */  
    651651                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           
    653654                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 
    655655                        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(){ 
    662661                        if (!button.hasClass('aActiveMenu'))  
    663662                        {  
     
    670669                }); 
    671670 
     671                // Open Menu, Create Listener 
    672672                menu.bind('toggleOpen', function(){ 
    673                         // Open Menu, Create Listener 
    674673                        button.addClass('aActiveMenu'); 
    675674                        menu.addClass(classname);                        
    676675                        if (overlay) { overlay.stop().show(); } 
    677676                        $(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                                { 
    681680                                        menu.trigger('toggleClosed'); 
    682681                                } 
    683                                 if (!target.parents().is('#'+menu.attr('id'))) { 
     682                                if ( !target.parents().is('#'+menu.attr('id')) )  
     683                                { 
    684684                                        menu.trigger('toggleClosed'); 
    685685                                }