comparison libervia/pages/_browser/invitation.py @ 1348:c74e5a488af6

browser (invitation): minor renaming
author Goffi <goffi@goffi.org>
date Sat, 05 Sep 2020 21:59:14 +0200
parents fe353fceec38
children 2938d1b65bd5
comparison
equal deleted inserted replaced
1347:48e2a8b07c0b 1348:c74e5a488af6
64 """Hide the panel""" 64 """Hide the panel"""
65 document.body.style.height, document.body.style.overflow = self._body_ori_style 65 document.body.style.height, document.body.style.overflow = self._body_ori_style
66 self.side_panel.classList.remove('open') 66 self.side_panel.classList.remove('open')
67 self.side_panel.bind("transitionend", self._on_close_transition_end) 67 self.side_panel.bind("transitionend", self._on_close_transition_end)
68 68
69 def invite_jid(self, entity_jid): 69 def invite_by_jid(self, entity_jid):
70 if self.invitation_type == 'photos': 70 if self.invitation_type == 'photos':
71 path = self.invitation_data["path"] 71 path = self.invitation_data["path"]
72 service = self.invitation_data["service"] 72 service = self.invitation_data["service"]
73 album_name = path.rsplit('/')[-1] 73 album_name = path.rsplit('/')[-1]
74 print(f"inviting {entity_jid}") 74 print(f"inviting {entity_jid}")
104 """User is adding a contact""" 104 """User is adding a contact"""
105 form_elt = document['invitation_form'] 105 form_elt = document['invitation_form']
106 contact_elt = form_elt.select_one('input[name="contact"]') 106 contact_elt = form_elt.select_one('input[name="contact"]')
107 contact_elt.value = "" 107 contact_elt.value = ""
108 contact_elt.dispatchEvent(window.Event.new('input')) 108 contact_elt.dispatchEvent(window.Event.new('input'))
109 self.invite_jid(entity_jid) 109 self.invite_by_jid(entity_jid)
110 110
111 def on_contact_keydown(self, evt): 111 def on_contact_keydown(self, evt):
112 if evt.key == "Escape": 112 if evt.key == "Escape":
113 evt.target.value = "" 113 evt.target.value = ""
114 evt.target.dispatchEvent(window.Event.new('input')) 114 evt.target.dispatchEvent(window.Event.new('input'))
143 elif evt.key == "Enter": 143 elif evt.key == "Enter":
144 evt.stopPropagation() 144 evt.stopPropagation()
145 evt.preventDefault() 145 evt.preventDefault()
146 if self._active_new_item is not None: 146 if self._active_new_item is not None:
147 entity_jid = self._active_new_item.dataset.entityJid 147 entity_jid = self._active_new_item.dataset.entityJid
148 self.invite_jid(entity_jid) 148 self.invite_by_jid(entity_jid)
149 149
150 def on_contact_focus(self, evt): 150 def on_contact_focus(self, evt):
151 search_dialog = document['invitation_contact_search'] 151 search_dialog = document['invitation_contact_search']
152 search_dialog.classList.add('open') 152 search_dialog.classList.add('open')
153 self._active_new_item = None 153 self._active_new_item = None