diff options
author | Koren Lev <korenlev@gmail.com> | 2017-09-29 01:38:18 +0300 |
---|---|---|
committer | Yaron Yogev <yaronyogev@gmail.com> | 2017-10-03 09:46:58 +0000 |
commit | d0adff06bed72f9a0edd7adccfa6a1111784bc8b (patch) | |
tree | 4b5eaf1107e6973b1eac636309a99c83074acbfc /ui/imports/ui/components/environment/environment.js | |
parent | fbbaf20912c79bd99a5c3696850d70c11965f56b (diff) |
release 1.0 calipso for opnfv apex
Change-Id: I3e63cd27c5f4d3756e67a07c749863a68e84dde2
Signed-off-by: Koren Lev <korenlev@gmail.com>
(cherry picked from commit d32f75145676bacefde0d08a14680a5984623451)
Diffstat (limited to 'ui/imports/ui/components/environment/environment.js')
-rw-r--r-- | ui/imports/ui/components/environment/environment.js | 57 |
1 files changed, 40 insertions, 17 deletions
diff --git a/ui/imports/ui/components/environment/environment.js b/ui/imports/ui/components/environment/environment.js index 1f0e723..9df6046 100644 --- a/ui/imports/ui/components/environment/environment.js +++ b/ui/imports/ui/components/environment/environment.js @@ -96,6 +96,7 @@ Template.Environment.onCreated(function () { vedgeInfoWindow: { node: null, left: 0, top: 0, show: false }, dashboardName: 'environment', collapsedSideMenu: instance.collapsedSideMenu, + isLoading: false, }); instance.currentData = new ReactiveVar(null, EJSON.equals); @@ -226,27 +227,44 @@ Template.Environment.onCreated(function () { }); - /* - (() => { - if (R.isNil(controller.params.query.selectedNodeId) && - R.isNil(selectedNodeId)) { - return; - } + /* + (() => { + if (R.isNil(controller.params.query.selectedNodeId) && + R.isNil(selectedNodeId)) { + return; + } - let srlSelectedNodeId = idToStr(selectedNodeId); - if (R.equals(controller.params.query.selectedNodeId, srlSelectedNodeId)) { - return; - } + let srlSelectedNodeId = idToStr(selectedNodeId); + if (R.equals(controller.params.query.selectedNodeId, srlSelectedNodeId)) { + return; + } - setTimeout(() => { - Router.go('environment', - { _id: controller.params._id }, - { query: { selectedNodeId: srlSelectedNodeId } }); - }, 1); + setTimeout(() => { + Router.go('environment', + { _id: controller.params._id }, + { query: { selectedNodeId: srlSelectedNodeId } }); + }, 1); + + })(); + */ - })(); - */ + let prevIdPath = null; + instance.autorun(function () { + let idPath = instance.rdxSelectedNodeIdPath.get(); + if (prevIdPath !== idPath) { + prevIdPath = idPath; + instance.state.set('isLoading', true); + } + }); + instance.autorun(function () { + let isLoading = instance.state.get('isLoading'); + if (isLoading) { + setTimeout(() => { + instance.state.set('isLoading', false); + }, 200); + } + }); }); Template.Environment.onDestroyed(function () { @@ -294,6 +312,11 @@ Template.Environment.helpers({ return instance.state.get(key); }, + isLoading: function () { + let instance = Template.instance(); + return instance.state.get('isLoading'); + }, + argsNavMenu: function (envName, mainNode) { let instance = Template.instance(); return { |