summaryrefslogtreecommitdiffstats
path: root/install/ui/ipa.js
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2011-01-26 20:58:06 -0500
committerAdam Young <ayoung@redhat.com>2011-01-27 16:59:17 -0500
commitd7f4d616df836f2f8590c8fd82ab165bd2f97cd5 (patch)
tree3f9fd542332e0a611d685c1b37898e966b4c5ba3 /install/ui/ipa.js
parent7462a852bd7f17c5525cf5b912df2932bc55e19e (diff)
downloadfreeipa-d7f4d616df836f2f8590c8fd82ab165bd2f97cd5.tar.gz
freeipa-d7f4d616df836f2f8590c8fd82ab165bd2f97cd5.tar.xz
freeipa-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/ipa.js')
-rw-r--r--install/ui/ipa.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/install/ui/ipa.js b/install/ui/ipa.js
index 406dce6d..128413b1 100644
--- a/install/ui/ipa.js
+++ b/install/ui/ipa.js
@@ -131,7 +131,38 @@ var IPA = ( function () {
}
};
+
+ that.test_dirty = function(){
+ if (IPA.current_entity){
+ var facet_name = IPA.current_facet(IPA.current_entity);
+ var facet = IPA.current_entity.facets_by_name[facet_name];
+ if (facet.is_dirty()){
+ var message_box = $("<div/>",{
+ html: IPA.messages.dirty
+ }).
+ appendTo($("#navigation"));
+ message_box.dialog({
+ title: 'Dirty',
+ modal:true,
+ width: '20em',
+ buttons: {
+ Ok: function() {
+ $( this ).dialog( "close" );
+ }
+ }
+ });
+ return false;
+ }
+ }
+ return true;
+ }
+
+
+
that.show_page = function (entity_name, facet_name) {
+ if (!IPA.test_dirty()){
+ return false;
+ }
var state = {};
state[entity_name + '-facet'] = facet_name;
@@ -139,6 +170,11 @@ var IPA = ( function () {
};
that.switch_and_show_page = function (this_entity, facet_name, pkey) {
+
+ if (!IPA.test_dirty()){
+ return false;
+ }
+
if (!pkey){
that.show_page(this_entity, facet_name);
return;