luci-base: cbi.js: rework dropdown implementation
authorJo-Philipp Wich <jo@mein.io>
Sat, 20 Oct 2018 08:06:57 +0000 (10:06 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 5 Nov 2018 10:01:45 +0000 (11:01 +0100)
commitc2b570998811accb7a880fe42745ee0278f323e6
tree52d6d406f56ea1b04a584f6172dae4423baf7f53
parent6b8fc99fd5897d9a0d959d567a02113ef5b2a328
luci-base: cbi.js: rework dropdown implementation

 - Refactor event handler closures into class methods and bind them instead
 - Fix quirk in dropdown placement calculation
 - Different dropdown placement strategy on touch devices
 - Broadcast custom "cbi-dropdown-change" event when value is changed
 - Implement setValues() method to alter dropdown selection
 - Prevent creating empty custom values

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/cbi.js