[Freeipa-devel] [PATCH] 029 Page is cleared before it is visible

Endi Sukma Dewata edewata at redhat.com
Mon Oct 31 22:38:29 UTC 2011


On 10/27/2011 4:57 AM, Petr Vobornik wrote:
> https://fedorahosted.org/freeipa/ticket/1459
>
> Changes:
> * added clear method to widgets, section, search, details, association
> facets
> * clear method in facet is called only if key/filter was changed

Some issues:

1. The new clear() method is called during refresh(), so the facet with 
the old data is still shown for a brief moment before it's cleared.

Take a look at the following code in IPA.entity.display():

     // same entity, same facet, and doesn't need updating => return
     if (that == prev_entity
         && that.facet == prev_facet
         && !that.facet.needs_update()) {
         return;
     }

     ...

     that.facet.show();
     that.facet.header.select_tab();
     that.facet.refresh();

The clear() should be called before show(). However, if the pkey/filter 
is unchanged (check using needs_update()) we just need to show() the 
facet, no need to clear() and refresh() again. The above logic needs to 
be fixed.

The we will need to override the needs_update() for search and 
association facets because the default one always returns true.

2. The following code in association.js and search.js will call clear() 
if there's no old pkey/filter, is this intentional? No old pkey/filter 
means the page is just loaded, so it probably doesn't need clearing.

if (!old_pkey || old_pkey[0] !== pkey[0]) {
     that.clear();
}

if (!old_filter || old_filter[0] !== filter[0]) {
     that.clear();
}

-- 
Endi S. Dewata




More information about the Freeipa-devel mailing list