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

40 lines
880 B
JavaScript
Raw Normal View History

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() {
2015-10-14 13:50:27 +02:00
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);
}
}
});