# HG changeset patch # User souliane # Date 1386667678 -3600 # Node ID 3216c8d5432b1833de9715bace3b9d46d9a9169b # Parent 20a9aedc60b5e51a30c6523de8d6d06ed5eded31 browser_side: set the ideal height for the contact panel size when displayed in the unibox panel diff -r 20a9aedc60b5 -r 3216c8d5432b browser_side/contact.py --- a/browser_side/contact.py Tue Dec 10 09:56:28 2013 +0100 +++ b/browser_side/contact.py Tue Dec 10 10:27:58 2013 +0100 @@ -30,7 +30,7 @@ from pyjamas import Window from pyjamas import DOM -from browser_side.panels import ChatPanel, MicroblogPanel, PopupMenuPanel, WebPanel +from browser_side.panels import ChatPanel, MicroblogPanel, PopupMenuPanel, WebPanel, UniBoxPanel from browser_side.tools import DragLabel, html_sanitize, setPresenceStyle from __pyjamas__ import doc @@ -243,15 +243,16 @@ def onWindowResized(self, width, height): contact_panel_elt = self.getElement() - _elts = doc().getElementsByClassName('gwt-TabBar') + classname = 'widgetsPanel' if isinstance(self.getParent().getParent(), UniBoxPanel) else'gwt-TabBar' + _elts = doc().getElementsByClassName(classname) if not _elts.length: - print ("ERROR: no TabBar found, it should exist !") + print ("ERROR: no element of class %s found, it should exist !" % classname) tab_bar_h = height else: tab_bar_h = DOM.getAbsoluteTop(_elts.item(0)) or height # getAbsoluteTop can be 0 if tabBar is hidden ideal_height = tab_bar_h - DOM.getAbsoluteTop(contact_panel_elt) - 5 - self.scroll_panel.setHeight("%s%s" % (ideal_height, "px")); + self.scroll_panel.setHeight("%s%s" % (ideal_height, "px")) def updateContact(self, jid, attributes, groups): """Add a contact to the panel if it doesn't exist, update it else