Skip to content

Commit

Permalink
Fix wenzhixin#3029: IE8 does not support getOwnPropertyNames
Browse files Browse the repository at this point in the history
  • Loading branch information
wenzhixin committed Dec 20, 2017
1 parent 5f1a46e commit 44f3bf5
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/bootstrap-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,16 @@

var compareObjects = function (objectA, objectB, compareLength) {
// Create arrays of property names
var objectAProperties = Object.getOwnPropertyNames(objectA),
objectBProperties = Object.getOwnPropertyNames(objectB),
var getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
var arr = [];
for (var k in obj) {
if (obj.hasOwnProperty(k)) {
arr.push(k);
}
return arr;
};
var objectAProperties = getOwnPropertyNames(objectA),
objectBProperties = getOwnPropertyNames(objectB),
propName = '';

if (compareLength) {
Expand Down Expand Up @@ -529,7 +537,7 @@
},
formatFullscreen: function () {
return 'Fullscreen';
},
},
formatColumns: function () {
return 'Columns';
},
Expand Down Expand Up @@ -961,7 +969,7 @@
} else {
this.options.data = data || this.options.data;
}

this.data = this.options.data;

if (this.options.sidePagination === 'server') {
Expand Down

0 comments on commit 44f3bf5

Please sign in to comment.