From 9afe4b98da13bbf1ce2fd68a660ee1d77fd84f2f Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Mon, 24 Oct 2011 14:53:29 +0200 Subject: Page is cleared before it is visible https://fedorahosted.org/freeipa/ticket/1459 Changes: * added clear method to widgets, section, search, details, association facets * clear and refresh method in facet are called only if key/filter was changed * added id generator for widgets --- install/ui/details.js | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'install/ui/details.js') diff --git a/install/ui/details.js b/install/ui/details.js index 98f48d0f..15056204 100644 --- a/install/ui/details.js +++ b/install/ui/details.js @@ -199,6 +199,14 @@ IPA.details_section = function(spec) { } }; + that.clear = function() { + var fields = that.fields.values; + + for (var i=0; i< fields.length; i++) { + fields[i].clear(); + } + }; + init(); // methods that should be invoked by subclasses @@ -409,8 +417,6 @@ IPA.details_facet = function(spec) { that.facet_create_header(container); - that.pkey = IPA.nav.get_state(that.entity.name+'-pkey'); - that.create_controls(); that.expand_button = IPA.action_button({ @@ -523,7 +529,7 @@ IPA.details_facet = function(spec) { that.needs_update = function() { var pkey = IPA.nav.get_state(that.entity.name+'-pkey'); - return pkey != that.pkey; + return pkey !== that.pkey; }; that.section_dirty_changed = function(dirty) { @@ -720,6 +726,15 @@ IPA.details_facet = function(spec) { command.execute(); }; + that.clear = function() { + that.header.clear(); + var sections = that.sections.values; + + for (var i=0; i< sections.length; i++) { + sections[i].clear(); + } + }; + that.add_sections(spec.sections); that.details_facet_create_content = that.create_content; -- cgit