summaryrefslogtreecommitdiffstats
path: root/install/ui/widget.js
diff options
context:
space:
mode:
Diffstat (limited to 'install/ui/widget.js')
-rw-r--r--install/ui/widget.js36
1 files changed, 31 insertions, 5 deletions
diff --git a/install/ui/widget.js b/install/ui/widget.js
index cea86fad0..9f7c8cae8 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;