From 2b1d775d28bf5262386f0e7ae3bdaceff3f9d99f Mon Sep 17 00:00:00 2001 From: xq2005 Date: Wed, 1 Dec 2010 07:11:30 +0000 Subject: [PATCH] select all lpars on this cec when it is clicked git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8291 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/js/nodes/physical.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/xCAT-UI/js/nodes/physical.js b/xCAT-UI/js/nodes/physical.js index dd2880c7c..c8e557a39 100644 --- a/xCAT-UI/js/nodes/physical.js +++ b/xCAT-UI/js/nodes/physical.js @@ -241,7 +241,32 @@ function createGraphical(bpa, fsp, area){ $('.fspDiv2, .fspDiv4, .fspDiv42').bind('click', function(){ var fspName = $(this).attr('value'); - showSelectDialog(fspList[fspName]['children']); + var selectCount = 0; + for (var lparIndex in fspList[fspName]['children']){ + var lparName = fspList[fspName]['children'][lparIndex]; + if (selectNode[lparName]){ + selectCount ++; + } + } + + //all the lpars are selected, so unselect nodes + if (selectCount == fspList[fspName]['children'].length){ + for (var lparIndex in fspList[fspName]['children']){ + var lparName = fspList[fspName]['children'][lparIndex]; + delete selectNode[lparName]; + $('#graphTable [name=' + lparName + ']').css('border-color', '#BDBDBD'); + } + } + //not select all lpars on the cec, so add all lpars into selectNode Hash. + else{ + for (var lparIndex in fspList[fspName]['children']){ + var lparName = fspList[fspName]['children'][lparIndex]; + selectNode[lparName] = 1; + $('#graphTable [name=' + lparName + ']').css('border-color', 'aqua'); + } + } + + updateSelectNodeDiv(); }); }