Blob Blame History Raw
From 7e92db5789ad09f0e1184691ba69fb087402f24c Mon Sep 17 00:00:00 2001
From: Ondrej Mular <omular@redhat.com>
Date: Wed, 2 Sep 2015 11:16:14 +0200
Subject: [PATCH] fix constraints removing in web UI

---
 pcsd/public/js/nodes-ember.js | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/pcsd/public/js/nodes-ember.js b/pcsd/public/js/nodes-ember.js
index d2f85bd..0943c65 100644
--- a/pcsd/public/js/nodes-ember.js
+++ b/pcsd/public/js/nodes-ember.js
@@ -562,9 +562,12 @@ Pcs.resourcesContainer = Ember.Object.create({
     self.set('constraints', constraints);
     var resource_map = self.get('resource_map');
     $.each(constraints, function(const_type, cons) {
-      $.each(cons, function(resource_id, cons_list) {
-        if (resource_id in resource_map)
-          resource_map[resource_id].set(const_type, cons_list);
+      $.each(resource_map, function(resource_id, resource_obj) {
+        if (resource_id in cons) {
+          resource_obj.set(const_type, cons[resource_id]);
+        } else {
+          resource_obj.set(const_type, []);
+        }
       });
     });
   }
-- 
1.9.1