diff options
author | Adam Young <ayoung@redhat.com> | 2011-01-26 20:58:06 -0500 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2011-01-27 16:59:17 -0500 |
commit | d7f4d616df836f2f8590c8fd82ab165bd2f97cd5 (patch) | |
tree | 3f9fd542332e0a611d685c1b37898e966b4c5ba3 /install/ui/widget.js | |
parent | 7462a852bd7f17c5525cf5b912df2932bc55e19e (diff) | |
download | freeipa.git-d7f4d616df836f2f8590c8fd82ab165bd2f97cd5.tar.gz freeipa.git-d7f4d616df836f2f8590c8fd82ab165bd2f97cd5.tar.xz freeipa.git-d7f4d616df836f2f8590c8fd82ab165bd2f97cd5.zip |
dirty
If a page is dirty, do not allow additional navigation until changes are saved or committed
https://fedorahosted.org/freeipa/ticket/726
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; |