Show help when clicking anywhere on item not just onfocus

This commit is contained in:
Kovid Goyal 2016-02-11 22:07:46 +05:30
parent 1290e28fa9
commit 788e545ddc

View File

@ -84,6 +84,7 @@ class Choices(ConfigItem):
select.appendChild(E.option(text, value=choice)) select.appendChild(E.option(text, value=choice))
select.addEventListener('change', self.ui_value_changed.bind(self)) select.addEventListener('change', self.ui_value_changed.bind(self))
select.addEventListener('focus', onfocus) select.addEventListener('focus', onfocus)
div.addEventListener('click', onfocus)
def to_ui(self, val): def to_ui(self, val):
self.control.value = val self.control.value = val
@ -104,6 +105,7 @@ class CheckBox(ConfigItem):
control = div.firstChild control = div.firstChild
control.addEventListener('change', self.ui_value_changed.bind(self)) control.addEventListener('change', self.ui_value_changed.bind(self))
control.addEventListener('focus', onfocus) control.addEventListener('focus', onfocus)
div.addEventListener('click', onfocus)
div.lastChild.addEventListener('click', self.toggle.bind(self)) div.lastChild.addEventListener('click', self.toggle.bind(self))
@property @property
@ -137,6 +139,7 @@ class SpinBox(ConfigItem):
control.setAttribute(attr, '' + val) control.setAttribute(attr, '' + val)
control.addEventListener('change', self.ui_value_changed.bind(self)) control.addEventListener('change', self.ui_value_changed.bind(self))
control.addEventListener('focus', onfocus) control.addEventListener('focus', onfocus)
div.addEventListener('click', onfocus)
def to_ui(self, val): def to_ui(self, val):
self.control.value = val self.control.value = val
@ -157,6 +160,7 @@ class LineEdit(ConfigItem):
control = div.lastChild control = div.lastChild
control.addEventListener('change', self.ui_value_changed.bind(self)) control.addEventListener('change', self.ui_value_changed.bind(self))
control.addEventListener('focus', onfocus) control.addEventListener('focus', onfocus)
div.addEventListener('click', onfocus)
def to_ui(self, val): def to_ui(self, val):
self.control.value = val or '' self.control.value = val or ''