diff --git a/javascript/CMSMain_left.js b/javascript/CMSMain_left.js index 7b57f8fa..0b256432 100755 --- a/javascript/CMSMain_left.js +++ b/javascript/CMSMain_left.js @@ -240,8 +240,7 @@ batchActionGlobals = { }, getCsvIds : function() { - var csvIDs = ""; - batchActionGlobals.count = 0; + var csvIDs = new Array(); var st = $('sitetree'); batchActionGlobals.newNodes = new Array(); for(var idx in batchActionGlobals.selectedNodes) { @@ -253,15 +252,18 @@ batchActionGlobals = { } else { var i, item, childrenTopublish = st.getTreeNodeByIdx(idx).getElementsByTagName('li'); for(i=0;item=childrenTopublish[i];i++) { - csvIDs += (csvIDs ? "," : "") + st.getIdxOf(childrenTopublish[i]); - batchActionGlobals.count++; + if(csvIDs.indexOf(st.getIdxOf(childrenTopublish[i])) == -1) { + csvIDs.push(st.getIdxOf(childrenTopublish[i])); + } + } + if(csvIDs.indexOf(idx) == -1) { + csvIDs.push(idx); } - csvIDs += (csvIDs ? "," : "") + idx; - batchActionGlobals.count++; } } } - return csvIDs; + batchActionGlobals.count=csvIDs.length; + return (csvIDs.toString()); }, unfilterSiteTree : function() { // Reload the site tree if it has been filtered