Changeset 2774 in products


Ignore:
Timestamp:
Sep 2, 2010 2:20:40 PM (14 years ago)
Author:
chervol
Message:

fixed the case when there is no actions to display

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/viewlets.py

    r2773 r2774  
    7070        self.tabs =[] 
    7171        self.normalize_actions(tool._getOb(conf.actions_category), context, 0) 
    72         current_item = 0 
     72        current_item = -1 
    7373        delta = 1000 
    74          
     74        if not self.tabs: 
     75            return [] 
    7576        for info in self.tabs: 
    7677            if  self.context_url.startswith(info['url']) and \ 
     
    7980               current_item = self.tabs.index(info) 
    8081        self.id_chain = []  
    81         self.mark_active(self.tabs[current_item]['id'],self.tabs[current_item]['title']) 
     82 
     83        if current_item > -1 and current_item < len(self.tabs): 
     84            self.mark_active(self.tabs[current_item]['id'],self.tabs[current_item]['title']) 
    8285        return  self._subactions(tool._getOb(conf.actions_category), context, 0) 
    8386         
Note: See TracChangeset for help on using the changeset viewer.