patch pour le bogue de toLowercase() appliqué sur un integer : on améliore la détection des nombre en acceptant les string qui sont des nombre + on passe toString() avant toLowercase pour ne pas planter quoi qu'on envoie comme type de valeur
This commit is contained in:
parent
b6f83ea2ad
commit
da912987cf
2 changed files with 9 additions and 9 deletions
|
@ -709,11 +709,11 @@ let monTableau = {
|
|||
this.quelleVue = vue;
|
||||
},
|
||||
ordonnerSelect(a, b) {
|
||||
if (Number.isInteger(a) && Number.isInteger(b)) {
|
||||
return a - b;
|
||||
if ((Number.isInteger(a) || parseInt(a) == a) && (Number.isInteger(b) || parseInt(b) == b)) {
|
||||
return parseInt(a) - parseInt(b);
|
||||
} else {
|
||||
let x = a.toLowerCase();
|
||||
let y = b.toLowerCase();
|
||||
let x = toString(a).toLowerCase();
|
||||
let y = toString(b).toLowerCase();
|
||||
if (x < y) {
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|||
|
||||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
||||
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
||||
|
||||
jQuery(function () {
|
||||
$('#app').on('click', '.url_action', function (e) {
|
||||
|
@ -822,11 +822,11 @@ var monTableau = {
|
|||
this.quelleVue = vue;
|
||||
},
|
||||
ordonnerSelect: function ordonnerSelect(a, b) {
|
||||
if (Number.isInteger(a) && Number.isInteger(b)) {
|
||||
return a - b;
|
||||
if ((Number.isInteger(a) || parseInt(a) == a) && (Number.isInteger(b) || parseInt(b) == b)) {
|
||||
return parseInt(a) - parseInt(b);
|
||||
} else {
|
||||
var x = a.toLowerCase();
|
||||
var y = b.toLowerCase();
|
||||
var x = toString(a).toLowerCase();
|
||||
var y = toString(b).toLowerCase();
|
||||
|
||||
if (x < y) {
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Reference in a new issue