Mercurial > libervia-web
diff browser_side/panels.py @ 402:d7e78cb78dfc
browser_side: HTMLTextEditor and LightTextEditor factorization
author | souliane <souliane@mailoo.org> |
---|---|
date | Thu, 13 Mar 2014 16:05:35 +0100 |
parents | ea03f898067f |
children | c393e7dc9ae6 |
line wrap: on
line diff
--- a/browser_side/panels.py Thu Mar 13 13:15:48 2014 +0100 +++ b/browser_side/panels.py Thu Mar 13 16:05:35 2014 +0100 @@ -944,18 +944,16 @@ return False -class StatusPanel(HTMLTextEditor, ClickHandler): +class StatusPanel(HTMLTextEditor): EMPTY_STATUS = '<click to set a status>' def __init__(self, host, status=''): self.host = host modifiedCb = lambda content: self.host.bridge.call('setStatus', None, self.host.status_panel.presence, content['text']) or True - HTMLTextEditor.__init__(self, {'text': status}, modifiedCb, None, single_line=True) + HTMLTextEditor.__init__(self, {'text': status}, modifiedCb, None, single_line=True, listen_click=True) self.edit(False) self.setStyleName('statusPanel') - ClickHandler.__init__(self) - self.addClickListener(self) @property def status(self): @@ -985,10 +983,7 @@ status = Const.PRESENCE[presence] else: status = self.EMPTY_STATUS - self.setHTML(addURLToText(status)) - - def onClick(self, sender): - self.edit(True) + self.display.setHTML(addURLToText(status)) class PresenceStatusPanel(HorizontalPanel, ClickHandler):