[#152] HP devices with port names "D##" not sorted by portsort.js
In naturalsort there is handling for Float, Decimal and Scientific notation. This looks for numbers like: '10.04f','10.039F','10.038d','1.528535047e5' It was breaking port sorting for ports named like "D1", "D10" etc. Have removed support for sorting these numbers as it's unlikely we need that in Netdisco, for now.
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
* See: http://js-naturalsort.googlecode.com/svn/trunk/naturalSort.js
|
||||
*/
|
||||
function portSort (a, b) {
|
||||
var re = /(^(-?\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,
|
||||
var re = /(^0x[0-9a-f]+$|[0-9]+)/gi,
|
||||
// string regex
|
||||
sre = /(^[ ]*|[ ]*$)/g,
|
||||
// octal regex
|
||||
@@ -56,8 +56,8 @@ function portSort (a, b) {
|
||||
oFyNcL += '';
|
||||
}
|
||||
|
||||
if (oFxNcL < oFyNcL) return -1;
|
||||
if (oFxNcL > oFyNcL) return 1;
|
||||
if (oFxNcL < oFyNcL) { return -1; }
|
||||
if (oFxNcL > oFyNcL) { return 1; }
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user