1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-16 00:00:03 +01:00
VILLASweb/app/components/entity-chart.js
Markus Grigull 9fdeeb2719 Add highlight of current plotted attribute
Change chart line color to blue.
2015-10-14 15:10:10 +02:00

39 lines
880 B
JavaScript

import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'div',
classNames: ['layout-page'],
currentProperty: null,
visibleProperty: function() {
var properties = this.get('entity.properties');
var prop = properties.objectAt(0);
this.setCurrentProperty(prop);
return prop;
}.property('entity'),
entityAvailable: function() {
if (this.get('entity')) {
var properties = this.get('entity.properties');
return (properties.get('length') > 0);
} else {
return false;
}
}.property('entity'),
setCurrentProperty: function(property) {
if (this.currentProperty) {
this.currentProperty.set('visible', false);
}
this.currentProperty = property;
this.currentProperty.set('visible', true);
},
actions: {
showPropertyValues(_prop) {
this.set('visibleProperty', _prop);
this.setCurrentProperty(_prop);
}
}
});