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