ソースを参照

Added radix to every parseInt call

Dustin Utecht 4 年 前
コミット
a56ec13527

+ 1 - 1
src/bootstrap-table.js

@@ -2559,7 +2559,7 @@ class BootstrapTable {
         id = id.toString()
       } else if (typeof rowUniqueId === 'number') {
         if ((Number(rowUniqueId) === rowUniqueId) && (rowUniqueId % 1 === 0)) {
-          id = parseInt(id)
+          id = parseInt(id, 10)
         } else if ((rowUniqueId === Number(rowUniqueId)) && (rowUniqueId !== 0)) {
           id = parseFloat(id)
         }

+ 1 - 1
src/extensions/pipeline/bootstrap-table-pipeline.js

@@ -105,7 +105,7 @@ BootstrapTable.prototype.onSort = function () {
 BootstrapTable.prototype.onPageListChange = function (event) {
   /* rebuild cache window on page size change */
   const target = $(event.currentTarget)
-  const newPageSize = parseInt(target.text())
+  const newPageSize = parseInt(target.text(), 10)
 
   this.options.pipelineSize = this.calculatePipelineSize(this.options.pipelineSize, newPageSize)
   this.resetCache = true

+ 1 - 1
src/extensions/treegrid/bootstrap-table-treegrid.js

@@ -75,7 +75,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
 
   initRow (item, idx, data, parentDom) {
     if (this.treeEnable) {
-      const parentId = Number.parseInt(item[this.options.parentIdField])
+      const parentId = parseInt(item[this.options.parentIdField], 10)
 
       if (
         this.options.rootParentId === parentId ||