comparison browser_side/panels.py @ 174:d97b0cba8b04

browser side: fix the line jump in unibox after entering something (work around a pyjamas bug)
author Goffi <goffi@goffi.org>
date Sun, 13 Jan 2013 22:26:16 +0100
parents 9441893e8f37
children ba95cd824e06
comparison
equal deleted inserted replaced
173:3d998119237e 174:d97b0cba8b04
441 else: 441 else:
442 print "Unknown selected host:",self.host.selected 442 print "Unknown selected host:",self.host.selected
443 type = "UNKNOWN" 443 type = "UNKNOWN"
444 return (type, target) 444 return (type, target)
445 445
446 def onBrowserEvent(self, event):
447 #XXX: woraroung a pyjamas bug: self.currentEvent is not set
448 # so the TextBox's cancelKey doens't work. This is a workaround
449 # FIXME: fix the bug upstream
450 self.currentEvent = event
451 TextArea.onBrowserEvent(self, event)
452
446 def onKeyPress(self, sender, keycode, modifiers): 453 def onKeyPress(self, sender, keycode, modifiers):
447 _txt = self.getText() 454 _txt = self.getText()
448 if not self._popup: 455 if not self._popup:
449 self.showWarning(self._getTarget(_txt)) 456 self.showWarning(self._getTarget(_txt))
450 else: 457 else:
466 _chat = self.host.selected 473 _chat = self.host.selected
467 mess_type = "groupchat" if _chat.type=='group' else "chat" 474 mess_type = "groupchat" if _chat.type=='group' else "chat"
468 self.host.bridge.call('sendMessage', None, str(_chat.target), _txt, '', mess_type) 475 self.host.bridge.call('sendMessage', None, str(_chat.target), _txt, '', mess_type)
469 self.setText('') 476 self.setText('')
470 self._timeCb(None) #we remove the popup 477 self._timeCb(None) #we remove the popup
478 sender.cancelKey()
471 479
472 """def complete(self): 480 """def complete(self):
473 481
474 #self.visible=False #XXX: self.visible is not unset in pyjamas when ENTER is pressed and a completion is done 482 #self.visible=False #XXX: self.visible is not unset in pyjamas when ENTER is pressed and a completion is done
475 #XXX: fixed directly on pyjamas, if the patch is accepted, no need to walk around this 483 #XXX: fixed directly on pyjamas, if the patch is accepted, no need to walk around this