changeset 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 f1ba38043d78
children f488692c4903
files browser_side/list_manager.py public/libervia.css
diffstat 2 files changed, 8 insertions(+), 3 deletions(-) [+]
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)
--- a/public/libervia.css	Fri Feb 07 20:14:11 2014 +0100
+++ b/public/libervia.css	Wed Feb 12 14:51:13 2014 +0100
@@ -1353,7 +1353,7 @@
     border-radius: 5px 5px 5px 5px;
 }
 
-.richTextRemoveIcon {
+.recipientRemoveIcon {
 	color: red;
     width:15px;
     height:15px;