On 11/4/2011 11:02 AM, Petr Vobornik wrote:
ACK and pushed to master.


Found another problem, changing page in the association facet didn't work because pkey is still the same. See the attached patch.

--
Endi S. Dewata
From 291626e4f4e464b907fae33291b430f8ead95055 Mon Sep 17 00:00:00 2001
From: Endi S. Dewata <edew...@redhat.com>
Date: Thu, 3 Nov 2011 23:43:58 -0500
Subject: [PATCH] Fixed problem changing page in association facet.

The association facet has been modified to detect page change to
determine whether the facet needs to be updated.

Ticket #1459
---
 install/ui/association.js |   10 ++++++++--
 install/ui/entity.js      |    6 ++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/install/ui/association.js b/install/ui/association.js
index 6ce8fea46caa57638273d53518ce0472df58ac2d..6ef73dafe445af5c68fb506c2450fa67724efd84 100644
--- a/install/ui/association.js
+++ b/install/ui/association.js
@@ -1165,7 +1165,7 @@ IPA.association_facet = function (spec) {
             that.table.total_pages = 1;
         }
 
-        that.table.current_page = 1;
+        delete that.table.current_page;
 
         that.table.refresh();
         that.table.unselect_all();
@@ -1207,8 +1207,14 @@ IPA.association_facet = function (spec) {
 
     that.needs_update = function() {
         if (that._needs_update !== undefined) return that._needs_update;
+
         var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
-        return that.pkey !== pkey;
+        if (that.pkey !== pkey) return true;
+
+        var page = parseInt(IPA.nav.get_state(that.entity_name+'-page'), 10) || 1;
+        if (that.table.current_page !== page) return true;
+
+        return false;
     };
 
     /*initialization*/
diff --git a/install/ui/entity.js b/install/ui/entity.js
index 75f781e627f39489e464b950dc64f54d3063b64b..f7bf992aada9070ea81fb0271a4dce41706a7914 100644
--- a/install/ui/entity.js
+++ b/install/ui/entity.js
@@ -156,8 +156,10 @@ IPA.entity = function(spec) {
         var facet_name = IPA.nav.get_state(that.name+'-facet');
         that.facet = that.get_facet(facet_name);
 
+        var needs_update = that.facet.needs_update();
+
         // same entity, same facet, and doesn't need updating => return
-        if (that == prev_entity && that.facet == prev_facet && !that.facet.needs_update()) {
+        if (that == prev_entity && that.facet == prev_facet && !needs_update) {
             return;
         }
 
@@ -175,7 +177,7 @@ IPA.entity = function(spec) {
             that.facet.create(facet_container);
         }
 
-        if (that.facet.needs_update()) {
+        if (needs_update) {
             that.facet.clear();
             that.facet.show();
             that.facet.header.select_tab();
-- 
1.7.5.1

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

Reply via email to