luci-base: cbi.js: update deps on dynlist changes, honor placeholder
authorJo-Philipp Wich <jo@mein.io>
Thu, 13 Dec 2018 10:27:52 +0000 (11:27 +0100)
committerJo-Philipp Wich <jo@mein.io>
Thu, 13 Dec 2018 10:35:38 +0000 (11:35 +0100)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/cbi.js

index 61b83e82941006f504d51b35cb26a75b5d23f419..6feb9fb35158a4d0d706d8541ffeb6901e43fb75 100644 (file)
@@ -919,6 +919,8 @@ CBIDynamicList = {
                        else if (!hidden || hidden.value >= value)
                                exists = !!item.parentNode.insertBefore(new_item, item);
                });
+
+               cbi_d_update();
        },
 
        removeItem: function(dl, item) {
@@ -933,6 +935,7 @@ CBIDynamicList = {
                }
 
                item.parentNode.removeChild(item);
+               cbi_d_update();
        },
 
        handleClick: function(ev) {
@@ -1018,6 +1021,7 @@ function cbi_dynlist_init(dl, datatype, optional, choices)
                'type': 'text',
                'name': 'cbi.dynlist.' + dl.getAttribute('data-prefix'),
                'class': 'cbi-input-text',
+               'placeholder': dl.getAttribute('data-placeholder'),
                'data-type': datatype,
                'data-optional': true
        })));