1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-23 00:00:02 +01:00
VILLASweb/app/components/plot-abstract.js
Markus Grigull da09935de1 Add plot-abstract component
plot-abstract is the base object for all plots.
Size changes on plots are saved to the server on the save button.
Add sortable mixin.
2016-07-17 18:43:08 +02:00

33 lines
830 B
JavaScript

import Ember from 'ember';
import Resizable from '../mixins/resizable';
export default Ember.Component.extend(Resizable, {
attributeBindings: [ 'style' ],
plot: null,
disabled_resize: false,
autoHide_resize: false,
style: function() {
return 'width: ' + this.get('plot.width') + 'px; height: ' + this.get('plot.height') + 'px;';
}.property('plot'),
stop_resize(event, ui) {
var width = ui.size.width;
var height = ui.size.height;
this.set('plot.width', width);
this.set('plot.height', height);
},
_updateUI: function() {
if (this.get('editing') === true) {
this.set('disabled_resize', false);
this.set('autoHide_resize', false);
} else {
this.set('disabled_resize', true);
this.set('autoHide_resize', true);
}
}.observes('editing').on('init')
});