[TIC-Web] fix the uncheck funcitons 78/111778/1
authorChulwoo Shin <cw1.shin@samsung.com>
Tue, 24 Jan 2017 11:54:59 +0000 (20:54 +0900)
committerChulwoo Shin <cw1.shin@samsung.com>
Tue, 24 Jan 2017 11:54:59 +0000 (20:54 +0900)
fix the uncheck functions on the web-ui

Change-Id: I40e86ddb657026d869c4195a7e2c5d237dd47046
Signed-off-by: Chulwoo Shin <cw1.shin@samsung.com>
public/src/js/page/package.js

index db9850b..5f654a4 100644 (file)
@@ -27,7 +27,7 @@ define([
     function _getChecked() {
         var checkedList = [];
         _.forEach(pkgInfo, function(value, key) {
-            if(value.view[0].state.checked === true) {
+            if(value.checked === true) {
                 checkedList.push(value);
             }
         });
@@ -59,9 +59,9 @@ define([
         });
 
         $tree.treeview('checkNode', [nodes, { silent: true }]);
-        _.forEach(nodes, function(node) {
-            node.state.checked = true;
-        });
+        // _.forEach(nodes, function(node) {
+        //     node.state.checked = true;
+        // });
     }
 
     // Compares two rpm version numbers (e.g. "1.7.1" or "1.2b").
@@ -163,7 +163,7 @@ define([
         // init check type
         _.forEach(pkgInfo, function(value, key) {
             // check type: -1(unchecked), 0(checked), 1~N(checking)
-            selected[value.id] = value.view[0].state.checked ? 0 : -1;
+            selected[value.id] = value.checked ? 0 : -1;
             scc_id[value.id] = 0;
         });
 
@@ -273,7 +273,7 @@ define([
             // TODO: default profile rpm should be selected
             _.forEach(provideList, function(provide) {
                 var tmpInfo = pkgInfo[provide.name];
-                if (tmpInfo.view[0].state.checked || selected[tmpInfo.id] >= 1) {
+                if (tmpInfo.checked || selected[tmpInfo.id] >= 1) {
                     return tmpInfo;
                 }
             });
@@ -774,9 +774,9 @@ define([
 
         function _checkAllBtnHandler() {
             $tree.treeview('checkAll', { silent: true });
-            _.forEach(packages, function(node) {
-                node.state.checked = true;
-                node.selfChecked = false;
+            _.forEach(pkgInfo, function(value, key){
+                value.checked = true;
+                value.selfChecked = false;
             });
             _updateSummary();
         }
@@ -786,9 +786,13 @@ define([
             // FIXME: bug for state.checked = false in treeview objects
             $tree.treeview('checkAll', { silent: true });
             $tree.treeview('uncheckAll', { silent: true });
-            _.forEach(packages, function(node) {
-                node.state.checked = false;
-                node.selfChecked = false;
+            _.forEach(pkgInfo, function(value, key){
+                value.checked = false;
+                value.selfChecked = false;
+                value.forward = null;
+                value.backward = null;
+                value.group = null;
+                groups = {};
             });
             _updateSummary();
         }