js: Utilize `utils.objectsEqual()` in `actiontable.select()`
This commit is contained in:
parent
2dbf9ca8ab
commit
47c2a8bdc1
|
@ -189,17 +189,7 @@
|
|||
this.rowActions()
|
||||
.filter(
|
||||
function (i, el) {
|
||||
var params = _this.getRowData($(el));
|
||||
if (_this.icinga.utils.objectKeys(params).length !== _this.icinga.utils.objectKeys(filter).length) {
|
||||
return false;
|
||||
}
|
||||
var equal = true;
|
||||
$.each(params, function(key, value) {
|
||||
if (filter[key] !== value) {
|
||||
equal = false;
|
||||
}
|
||||
});
|
||||
return equal;
|
||||
return _this.icinga.utils.objectsEqual(_this.getRowData($(el)), filter);
|
||||
}
|
||||
)
|
||||
.closest('tr')
|
||||
|
|
|
@ -365,8 +365,13 @@
|
|||
},
|
||||
|
||||
objectsEqual: function equals(obj1, obj2) {
|
||||
return Object.keys(obj1)
|
||||
.concat(Object.keys(obj2))
|
||||
var obj1Keys = Object.keys(obj1);
|
||||
var obj2Keys = Object.keys(obj2);
|
||||
if (obj1Keys.length !== obj2Keys.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return obj1Keys.concat(obj2Keys)
|
||||
.every(function (key) {
|
||||
return obj1[key] === obj2[key];
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue