Skip to content

Commit

Permalink
Merge branch 'unstable' of https://github.com/iVis-at-Bilkent/newt in…
Browse files Browse the repository at this point in the history
…to unstable
  • Loading branch information
metincansiper committed Mar 14, 2017
2 parents c6fb72a + 4c732fa commit 407aa27
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/js/app-utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -564,17 +564,20 @@ appUtilities.applyMapColorScheme = function() {
currentScheme = appUtilities.currentGeneralProperties.mapColorScheme;
idMap = appUtilities.mapEleClassToId(eles, mapColorSchemes[currentScheme]['values']);

var actions = [];
// edit style of the current map elements
chise.changeCss(eles, 'background-color', idMap);
actions.push({name: "changeCss", param: {eles: eles, name: 'background-color', valueMap: idMap}});

// set to be the default as well
for(var nodeClass in mapColorSchemes[currentScheme]['values']){
classBgColor = mapColorSchemes[currentScheme]['values'][nodeClass];
// nodeClass may not be defined in the defaultProperties (for edges, for example)
if(nodeClass in chise.elementUtilities.defaultProperties){
chise.elementUtilities.defaultProperties[nodeClass]['background-color'] = classBgColor;
actions.push({name: "setDefaultProperty", param: {class: nodeClass, name: 'background-color', value: classBgColor}});
}
}
cy.undoRedo().do("batch", actions);

};

module.exports = appUtilities;

0 comments on commit 407aa27

Please sign in to comment.