Re: [Freeipa-devel] [PATCH] 211 Prevent opening of multiple dirty dialogs on navigation

2012-09-10 Thread Endi Sukma Dewata

On 9/7/2012 7:37 AM, Petr Vobornik wrote:

Facets which performs AJAX call after update refresh (clear dirty state)
after calling callback of dirty dialog. It might lead to multiple
openings of dirty dialog.

Assuming that calling dirty dialog's callback can be evaluated as dirty
state is gone, we can call reset in the callback to prevent the issue.
There will be an incorrect state in the facet for a moment. It will be
fixed soon on execute of callback of the refresh AJAX call. It is not an
issue because it will happen in background. User will be looking on
different facet.

https://fedorahosted.org/freeipa/ticket/2667


ACK.

--
Endi S. Dewata

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


[Freeipa-devel] [PATCH] 211 Prevent opening of multiple dirty dialogs on navigation

2012-09-07 Thread Petr Vobornik
Facets which performs AJAX call after update refresh (clear dirty state) 
after calling callback of dirty dialog. It might lead to multiple 
openings of dirty dialog.


Assuming that calling dirty dialog's callback can be evaluated as dirty 
state is gone, we can call reset in the callback to prevent the issue. 
There will be an incorrect state in the facet for a moment. It will be 
fixed soon on execute of callback of the refresh AJAX call. It is not an 
issue because it will happen in background. User will be looking on 
different facet.


https://fedorahosted.org/freeipa/ticket/2667
--
Petr Vobornik
From 30f0c69ed718796806ccfc1dd1a4d9243980cb5f Mon Sep 17 00:00:00 2001
From: Petr Vobornik pvobo...@redhat.com
Date: Fri, 7 Sep 2012 14:24:58 +0200
Subject: [PATCH] Prevent opening of multiple dirty dialogs on navigation

Facets which performs AJAX call after update refresh (clear dirty state) after calling callback of dirty dialog. It might lead to multiple openings of dirty dialog.

Assuming that calling dirty dialog's callback can be evaluated as dirty state is gone, we can call reset in the callback to prevent the issue. There will be an incorrect state in the facet for a moment. It will be fixed soon on execute of callback of the refresh AJAX call. It is not an issue because it will happen in background. User will be looking on different facet.

https://fedorahosted.org/freeipa/ticket/2667
---
 install/ui/navigation.js | 5 +
 1 file changed, 5 insertions(+)

diff --git a/install/ui/navigation.js b/install/ui/navigation.js
index 502b05490217e1c90b157ce4a242813e8e9968ab..deef37dd8a73128e5de2b3e9725e5161d5406b1c 100644
--- a/install/ui/navigation.js
+++ b/install/ui/navigation.js
@@ -134,6 +134,11 @@ IPA.navigation = function(spec) {
 });
 
 dialog.callback = function() {
+
+// Some facet's might not call reset before this call but after
+// so they are still dirty. Calling reset prevent's opening of
+// dirty dialog again.
+if (prev_facet.is_dirty()) prev_facet.reset();
 $.bbq.pushState(params);
 };
 
-- 
1.7.11.4

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel