From d7f4d616df836f2f8590c8fd82ab165bd2f97cd5 Mon Sep 17 00:00:00 2001 From: Adam Young Date: Wed, 26 Jan 2011 20:58:06 -0500 Subject: dirty If a page is dirty, do not allow additional navigation until changes are saved or committed https://fedorahosted.org/freeipa/ticket/726 --- install/ui/widget.js | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) (limited to 'install/ui/widget.js') 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