luci-base: cbi: fix button handling for dynamic lists
authorJo-Philipp Wich <jow@openwrt.org>
Fri, 19 Feb 2016 16:20:50 +0000 (17:20 +0100)
committerJo-Philipp Wich <jow@openwrt.org>
Fri, 19 Feb 2016 16:21:06 +0000 (17:21 +0100)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
modules/luci-base/htdocs/luci-static/resources/cbi.js

index 26fd92471ff5d9faaf40883b667ca775015a4555..b285ee26ccf1b656f9cd4648b38214d393473e14 100644 (file)
@@ -592,6 +592,7 @@ function cbi_combobox(id, values, def, man, focus) {
        var obj = document.getElementById(id)
        var sel = document.createElement("select");
                sel.id = selid;
+               sel.index = obj.index;
                sel.className = obj.className.replace(/cbi-input-text/, 'cbi-input-select');
 
        if (obj.nextSibling) {
@@ -925,14 +926,14 @@ function cbi_dynlist_init(parent, datatype, optional, choices)
                        input.value = '';
 
                        cbi_dynlist_keydown({
-                               target:  se,
+                               target:  input,
                                keyCode: 8
                        });
                }
                else
                {
                        cbi_dynlist_keydown({
-                               target:  se,
+                               target:  input,
                                keyCode: 13
                        });
                }