Revert "luci-base: override the load() function to return boolean for FlagValue"
authorPaul Donald <[email protected]>
Thu, 12 Jun 2025 12:51:58 +0000 (14:51 +0200)
committerPaul Donald <[email protected]>
Thu, 12 Jun 2025 12:51:58 +0000 (14:51 +0200)
This reverts commit 4cca2c6e4b8e403632e8e47bd3b22afa2605eac1.

Signed-off-by: Paul Donald <[email protected]>
modules/luci-base/htdocs/luci-static/resources/form.js

index db3da638a3cdd510d28ae77bb011490ef5c5684b..13ca76450ea7ff32e52bf14ca38f64dbc434abc6 100644 (file)
@@ -4000,19 +4000,6 @@ var CBIFlagValue = CBIValue.extend(/** @lends LuCI.form.FlagValue.prototype */ {
         * @default 'ℹ️';
         */
 
-       /**
-        * Coerce the various forms of a 'boolean' string into a true/false value.
-        *
-        * @override
-        */
-       load() {
-               // 
-               let load = this.super('load', arguments);
-               if (typeof(load) == 'string')
-                       load = ['1', 'on', 'true', 'yes', 'enabled'].includes(load.toLowerCase());
-               return load;
-       },
-
        /** @private */
        renderWidget: function(section_id, option_index, cfgvalue) {
                var tooltip = null;