diff options
Diffstat (limited to 'install/ui/widget.js')
-rw-r--r-- | install/ui/widget.js | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/install/ui/widget.js b/install/ui/widget.js index cea86fad..9f7c8cae 100644 --- a/install/ui/widget.js +++ b/install/ui/widget.js @@ -126,14 +126,40 @@ IPA.widget = function(spec) { } that.is_dirty = function() { - + if (that.read_only) { + return false; + } var values = that.save(); - if (!values && !that.values) return false; - if (!values || !that.values) return true; - if (values.length != that.values.length) return true; + if (!that.values){ + if (!values) { + return false; + } + if ( values === "" ){ + return false; + } + if ((values instanceof Array) && + (values.length ===1) && + (values[0] === "")){ + return false; + } + + if ((values instanceof Array) && + (values.length === 0)){ + return false; + } + + if (values) { + return true; + } + } + if (values.length != that.values.length) { + return true; + } for (var i=0; i<values.length; i++) { - if (values[i] != that.values[i]) return true; + if (values[i] != that.values[i]) { + return true; + } } return false; |