From 31d0e2a33a31f2aeec0b1c2ed8ccfe0a8b30863d Mon Sep 17 00:00:00 2001 From: "Eric A. Miller" Date: Fri, 8 Aug 2014 21:46:07 -0400 Subject: [PATCH] no globals --- Netdisco/share/public/javascripts/portsort.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Netdisco/share/public/javascripts/portsort.js b/Netdisco/share/public/javascripts/portsort.js index ca528572..57f932ef 100644 --- a/Netdisco/share/public/javascripts/portsort.js +++ b/Netdisco/share/public/javascripts/portsort.js @@ -40,8 +40,8 @@ function portSort (a, b) { yN = y.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'); for(var cLoc=0, numS=Math.max(xN.length, yN.length); cLoc < numS; cLoc++) { // find floats not starting with '0', string or 0 if not defined (Clint Priest) - oFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc]) || xN[cLoc] || 0; - oFyNcL = !(yN[cLoc] || '').match(ore) && parseFloat(yN[cLoc]) || yN[cLoc] || 0; + var oFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc]) || xN[cLoc] || 0; + var oFyNcL = !(yN[cLoc] || '').match(ore) && parseFloat(yN[cLoc]) || yN[cLoc] || 0; // handle numeric vs string comparison - number < string - (Kyle Adams) if (isNaN(oFxNcL) !== isNaN(oFyNcL)) return (isNaN(oFxNcL)) ? 1 : -1; // rely on string comparison if different types - i.e. '02' < 2 != '02' < '2'