diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2014-02-14 19:18:30 +0100 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2014-04-15 12:41:53 +0200 |
commit | a1c25122788ec7d9d7953db840ca6067f979432d (patch) | |
tree | a2ca7c207f51cea0764daf03ec3c390d07ab412b | |
parent | 93c4a6388bf05a754403a888e95e4a887180d9b1 (diff) | |
download | freeipa-a1c25122788ec7d9d7953db840ca6067f979432d.tar.gz freeipa-a1c25122788ec7d9d7953db840ca6067f979432d.tar.xz freeipa-a1c25122788ec7d9d7953db840ca6067f979432d.zip |
webui: publish network activity topics
Network activity is now published through global topics. It allows other
components like activity_widget to listen to them.
https://fedorahosted.org/freeipa/ticket/3903
Reviewed-By: Adam Misnyovszki <amisnyov@redhat.com>
-rw-r--r-- | install/ui/src/freeipa/ipa.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/install/ui/src/freeipa/ipa.js b/install/ui/src/freeipa/ipa.js index 3d84f9114..d6ae67d9c 100644 --- a/install/ui/src/freeipa/ipa.js +++ b/install/ui/src/freeipa/ipa.js @@ -24,6 +24,7 @@ define([ 'dojo/keys', + 'dojo/topic', './jquery', './json2', './_base/i18n', @@ -34,7 +35,8 @@ define([ './rpc', './text', 'exports' - ], function(keys, $, JSON, i18n, datetime, metadata_provider, builder, reg, rpc, text, exports) { + ], function(keys, topic, $, JSON, i18n, datetime, metadata_provider, + builder, reg, rpc, text, exports) { /** * @class @@ -318,6 +320,9 @@ var IPA = function () { that.display_activity_icon = function() { that.network_call_count++; $('.network-activity-indicator').css('visibility', 'visible'); + if (that.network_call_count === 1) { + topic.publish('network-activity-start'); + } }; /** @@ -330,6 +335,7 @@ var IPA = function () { if (0 === that.network_call_count) { $('.network-activity-indicator').css('visibility', 'hidden'); + topic.publish('network-activity-end'); } }; |