Changeset 524

Show
Ignore:
Timestamp:
08/08/07 00:41:07 (1 year ago)
Author:
ian
Message:

Added shadow under TreeMenu?, added hook to deselect the node when its menu goes away

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • pagoda/trunk/Pagoda/pagoda/widgets/admin/static/javascript/tree_menu.js

    r523 r524  
    33 
    44    // Configure this menu 
    5     this.shadow = false; 
     5    this.shadow = true; 
    66    Ext.menu.TreeMenu.superclass.constructor.call(this, config); 
    77 
     
    7373        this.tree = tree; 
    7474 
    75         // Given a node, returns the underlying element 
    76         var get_node_el = function (node) { 
    77             return node.ui.getEl(); 
    78         } 
     75        // When a node in the tree is clicked, show the menu on that node 
     76        this.tree.on('click', function(node) { 
     77            this.tree_node = node; 
     78            this.show(this.tree_node.ui.getEl(), position); 
     79        }, this); 
    7980 
    80         // When a node in the tree is clicked, show the menu 
    81         this.tree.on('click', function(node) { 
    82             var node_el = get_node_el(node); 
    83             this.show(node_el, position); 
    84         }, this); 
     81        // Likewise when the menu goes away, deselect the tree node 
     82        this.on('hide', function(menu) { 
     83            menu.tree_node.unselect(); 
     84        }); 
    8585    } 
    8686}); 

Log in as guest/pagoda to create tickets