mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-16 00:00:03 +01:00
39 lines
880 B
JavaScript
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);
|
|
}
|
|
}
|
|
});
|