Blame SOURCES/bz1231858-01-web-UI-fix-occasional-issue-with-not-showing-optiona.patch

15f218
From 4fbf6a24492b0ac61be7822208275f1837165ae2 Mon Sep 17 00:00:00 2001
15f218
From: Ondrej Mular <omular@redhat.com>
15f218
Date: Fri, 22 Jul 2016 13:37:28 +0200
15f218
Subject: [PATCH] web UI: fix occasional issue with not showing optional
15f218
 arguments of resources
15f218
15f218
---
15f218
 pcsd/public/js/nodes-ember.js | 12 ++++--------
15f218
 pcsd/public/js/pcsd.js        | 17 +++++++----------
15f218
 2 files changed, 11 insertions(+), 18 deletions(-)
15f218
15f218
diff --git a/pcsd/public/js/nodes-ember.js b/pcsd/public/js/nodes-ember.js
15f218
index cb62806..2b43559 100644
15f218
--- a/pcsd/public/js/nodes-ember.js
15f218
+++ b/pcsd/public/js/nodes-ember.js
15f218
@@ -210,20 +210,16 @@ Pcs = Ember.Application.createWithMixins({
15f218
           Ember.run.scheduleOnce('afterRender', Pcs, function () {
15f218
             if (self.get('cur_fence')) {
15f218
               if (fence_change) {
15f218
-                if (first_run) {
15f218
-                  update_instance_attributes(self.get('cur_fence').get('id'));
15f218
-                }
15f218
-                tree_view_onclick(self.get('cur_fence').get('id'), true);
15f218
+                tree_view_onclick(self.get('cur_fence').get('id'), first_run);
15f218
               } else {
15f218
                 tree_view_select(self.get('cur_fence').get('id'));
15f218
               }
15f218
             }
15f218
             if (self.get('cur_resource')) {
15f218
               if (resource_change) {
15f218
-                if (first_run) {
15f218
-                  update_instance_attributes(self.get('cur_resource').get('id'));
15f218
-                }
15f218
-                tree_view_onclick(self.get('cur_resource').get('id'), true);
15f218
+                tree_view_onclick(
15f218
+                  self.get('cur_resource').get('id'), first_run
15f218
+                );
15f218
               } else {
15f218
                 tree_view_select(self.get('cur_resource').get('id'));
15f218
               }
15f218
diff --git a/pcsd/public/js/pcsd.js b/pcsd/public/js/pcsd.js
15f218
index e763482..1ec0f1c 100644
15f218
--- a/pcsd/public/js/pcsd.js
15f218
+++ b/pcsd/public/js/pcsd.js
15f218
@@ -2108,29 +2108,26 @@ function update_instance_attributes(resource_id) {
15f218
   }, res_obj.get("stonith"));
15f218
 }
15f218
 
15f218
-function tree_view_onclick(resource_id, auto) {
15f218
-  auto = typeof auto !== 'undefined' ? auto : false;
15f218
+function tree_view_onclick(resource_id, first_run) {
15f218
+  first_run = typeof first_run !== 'undefined' ? first_run : false;
15f218
   var resource_obj = Pcs.resourcesContainer.get_resource_by_id(resource_id);
15f218
   if (!resource_obj) {
15f218
     console.log("Resource " + resource_id + "not found.");
15f218
     return;
15f218
   }
15f218
   if (resource_obj.get('stonith')) {
15f218
-    Pcs.resourcesContainer.set('cur_fence', resource_obj);
15f218
-    if (!auto) {
15f218
+    if (!first_run) {
15f218
       window.location.hash = "/fencedevices/" + resource_id;
15f218
-      update_instance_attributes(resource_id);
15f218
     }
15f218
+    Pcs.resourcesContainer.set('cur_fence', resource_obj);
15f218
   } else {
15f218
-    Pcs.resourcesContainer.set('cur_resource', resource_obj);
15f218
-
15f218
-    if (!auto) {
15f218
+    if (!first_run) {
15f218
       window.location.hash = "/resources/" + resource_id;
15f218
-      update_instance_attributes(resource_id);
15f218
     }
15f218
+    Pcs.resourcesContainer.set('cur_resource', resource_obj);
15f218
     auto_show_hide_constraints();
15f218
   }
15f218
-
15f218
+  update_instance_attributes(resource_id);
15f218
   tree_view_select(resource_id);
15f218
 }
15f218
 
15f218
-- 
15f218
1.8.3.1
15f218