mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-23 00:00:02 +01:00

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.
33 lines
830 B
JavaScript
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')
|
|
});
|