cronapp-common-js 2.8.14 → 2.8.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2474,18 +2474,17 @@ angular.module('datasourcejs', [])
|
|
|
2474
2474
|
|
|
2475
2475
|
this.findObj = function(keyObj, multiple, onSuccess, onError, useKeys) {
|
|
2476
2476
|
|
|
2477
|
-
|
|
2478
|
-
this.keys = useKeys || this.keys;
|
|
2477
|
+
let keys = useKeys || deepCopy(this.keys);
|
|
2479
2478
|
|
|
2480
|
-
|
|
2481
|
-
for (let i=0;i<
|
|
2482
|
-
if (objectsAreEqual(
|
|
2479
|
+
let filterValues = function(elem) {
|
|
2480
|
+
for (let i=0;i<keys.length;i++) {
|
|
2481
|
+
if (objectsAreEqual(keyObj[i], elem[keys[i]])) {
|
|
2483
2482
|
return elem;
|
|
2484
2483
|
}
|
|
2485
2484
|
}
|
|
2486
2485
|
}.bind(this);
|
|
2487
2486
|
|
|
2488
|
-
let values = this.data.filter(
|
|
2487
|
+
let values = this.data.filter(filterValues);
|
|
2489
2488
|
if (values && values.length > 0) {
|
|
2490
2489
|
if (onSuccess) onSuccess(values);
|
|
2491
2490
|
return;
|
|
@@ -2508,7 +2507,7 @@ angular.module('datasourcejs', [])
|
|
|
2508
2507
|
this.fetch(filterData, {
|
|
2509
2508
|
success: function(data) {
|
|
2510
2509
|
if (onSuccess) {
|
|
2511
|
-
let values = data.filter(
|
|
2510
|
+
let values = data.filter(filterValues);
|
|
2512
2511
|
onSuccess(values);
|
|
2513
2512
|
}
|
|
2514
2513
|
}.bind(this),
|