}
node.actElemStructure.clear();
- for (var prop in actData) {
+ Object.keys(actData).forEach(function(prop) {
node.actElemStructure.fillListElement(prop, actData[prop]);
- }
+ });
EventDispatcherService.dispatch(constants.EV_LIST_CHANGED, node.actElemStructure);
};
var actData = node.listData[node.actElemIndex];
node.actElemStructure.clear();
- for (var prop in actData) {
+ Object.keys(actData).forEach(function(prop) {
node.actElemStructure.fillListElement(prop, actData[prop]);
- }
+ });
}
EventDispatcherService.dispatch(constants.EV_LIST_CHANGED, node.actElemStructure);
var buildedDataCopy = node.listData.slice().map(function (item) {
var newItem = {};
- for (var prop in item){
+ Object.keys(item).forEach(function(prop) {
if (prop !== '$$hashKey'){
newItem[prop] = item[prop];
}
- }
+ });
return newItem;
}).filter(function (item){
return Object.keys(item).length !== 0;
node.createStructure();
node.listData = array.slice();
node.actElemIndex = node.listData.length - 1;
- for (var prop in node.listData[node.actElemIndex]) {
+
+ Object.keys(node.listData[node.actElemIndex]).forEach(function(prop) {
node.actElemStructure.fillListElement(prop, node.listData[node.actElemIndex][prop]);
- }
+ });
}
return (match && array.length > 0);
if (match && nodesToFill.length) {
nodesToFill.forEach(function (child) {
- for (var prop in data) {
+ Object.keys(data).forEach(function(prop) {
child.fill(prop, data[prop]);
- }
+ });
});
node.expanded = match;
}
if (match && nodesToFill.length) {
nodesToFill.forEach(function (child) {
- for (var prop in data) {
+ Object.keys(data).forEach(function(prop) {
child.fill(prop, data[prop]);
- }
+ });
});
node.expanded = match;
}
if (match && nodesToFill.length) {
nodesToFill.forEach(function (child) {
- for (var prop in data) {
+ Object.keys(data).forEach(function(prop) {
child.fill(prop, data[prop]);
- }
+ });
});
}
if (match && nodesToFill.length) {
nodesToFill.forEach(function (child) {
- for (var prop in data) {
+ Object.keys(data).forEach(function(prop) {
child.fill(prop, data[prop]);
- }
+ });
});
node.expanded = match;
* @param reqObj HistoryRequest object to be selected
*/
function toggleReqSelection(onlyOneSelected, reqObj){
-
- //self.collections.forEach(function (collection){
- // collection.data.forEach(function (req){
- // req.selected = reqObj === req;
- // });
- //});
-
if (onlyOneSelected){
self.selectedItems.forEach(function (req){
req.selected = false;
* Get expanded collection names
*/
function getExpandedCollectionNames(){
- var expandCollectionNames = [];
- self.collections.forEach(function(collection){
- if (collection.expanded) {
- expandCollectionNames.push(collection.name);
- }
+ return self.collections.filter(function(collection){
+ return collection.expanded;
+ }).map(function(collection){
+ return collection.name;
});
- return expandCollectionNames;
}
/**
* Expand collections by expandCollectionNames
*/
function expandCollectionByNames(expandCollectionNames){
-
self.collections.forEach(function(collection){
if (findName(collection.name)) {
collection.expanded = true;
});
function findName(name) {
- var found = false;
- expandCollectionNames.forEach(function(collectionName){
- if (name === collectionName) {
- found = true;
- return null;
- }
+ return expandCollectionNames.some(function(collectionName){
+ return name === collectionName;
});
- return found;
}
-
}
}