Mercurial > libervia-web
diff browser_side/list_manager.py @ 348:83454ba70a9c
browser_side: added a method setVisible to ListManager
author | souliane <souliane@mailoo.org> |
---|---|
date | Wed, 12 Feb 2014 14:51:13 +0100 |
parents | ce5b33f499c5 |
children | a71fcc27f231 |
line wrap: on
line diff
--- a/browser_side/list_manager.py Fri Feb 07 20:14:11 2014 +0100 +++ b/browser_side/list_manager.py Wed Feb 12 14:51:13 2014 +0100 @@ -38,7 +38,7 @@ # HTML content for the removal button (image or text) -REMOVE_BUTTON = '<span class="richTextRemoveIcon">x</span>' +REMOVE_BUTTON = '<span class="recipientRemoveIcon">x</span>' # Item to be considered for an empty list box selection. # Could be whatever which doesn't look like a JID or a group name. @@ -141,15 +141,20 @@ # this is done if self.registerPopupMenuPanel has been called yet self.popup_menu.registerClickSender(button) - def _refresh(self): + def _refresh(self, visible=True): """Set visible the sub-panels that are non optional or non empty, hide the rest.""" for key in self.__children: self.setContactPanelVisible(key, False) + if not visible: + return _map = self.getContacts() for key in _map: if len(_map[key]) > 0 or not self.__keys_dict[key]["optional"]: self.setContactPanelVisible(key, True) + def setVisible(self, visible): + self._refresh(visible) + def setContactPanelVisible(self, key, visible=True, sender=None): """Do not remove the "sender" param as it is needed for the context menu.""" self.__children[key]["button"].setVisible(visible)