luci-base: tools/widgets.js: honour map readonly property too
authorJo-Philipp Wich <jo@mein.io>
Tue, 14 Apr 2020 15:12:47 +0000 (17:12 +0200)
committerJo-Philipp Wich <jo@mein.io>
Thu, 7 May 2020 17:40:49 +0000 (19:40 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit c89fd0a7f324bb6c0ebd803f542bb63d49e41984)

modules/luci-base/htdocs/luci-static/resources/tools/widgets.js

index 38693c5b09ec38118a7bd51948e39f61f7b4a23f..7f724a17e42c851aed57fa180762d1744f8ff9d9 100644 (file)
@@ -134,7 +134,7 @@ var CBIZoneSelect = form.ListValue.extend({
                        sort: true,
                        multiple: this.multiple,
                        optional: this.optional || this.rmempty,
-                       disabled: this.readonly,
+                       disabled: (this.readonly != null) ? this.readonly : this.map.readonly,
                        select_placeholder: E('em', _('unspecified')),
                        display_items: this.display_size || this.size || 3,
                        dropdown_items: this.dropdown_size || this.size || 5,
@@ -389,7 +389,7 @@ var CBINetworkSelect = form.ListValue.extend({
                        sort: true,
                        multiple: this.multiple,
                        optional: this.optional || this.rmempty,
-                       disabled: this.readonly,
+                       disabled: (this.readonly != null) ? this.readonly : this.map.readonly,
                        select_placeholder: E('em', _('unspecified')),
                        display_items: this.display_size || this.size || 3,
                        dropdown_items: this.dropdown_size || this.size || 5,
@@ -557,7 +557,7 @@ var CBIDeviceSelect = form.ListValue.extend({
                        sort: order,
                        multiple: this.multiple,
                        optional: this.optional || this.rmempty,
-                       disabled: this.readonly,
+                       disabled: (this.readonly != null) ? this.readonly : this.map.readonly,
                        select_placeholder: E('em', _('unspecified')),
                        display_items: this.display_size || this.size || 3,
                        dropdown_items: this.dropdown_size || this.size || 5,