diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-08-29 22:34:54 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-08-29 22:34:54 -0400 |
| commit | 01755335859b19756f6d64a2f8a10ae98abceb5f (patch) | |
| tree | d5ba0258769f85fff5512498b04c3c037daecf79 /public/assets/javascripts/ui/editor/MediaEditor.js | |
| parent | 2235c34e498499b8141e835998b962067583a0ce (diff) | |
| parent | 851ddfd46abb7f944c1a6b7f198b5fd8cabd4c13 (diff) | |
merge
Diffstat (limited to 'public/assets/javascripts/ui/editor/MediaEditor.js')
| -rw-r--r-- | public/assets/javascripts/ui/editor/MediaEditor.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/public/assets/javascripts/ui/editor/MediaEditor.js b/public/assets/javascripts/ui/editor/MediaEditor.js index cc924da..750cf41 100644 --- a/public/assets/javascripts/ui/editor/MediaEditor.js +++ b/public/assets/javascripts/ui/editor/MediaEditor.js @@ -116,17 +116,18 @@ var MediaEditor = FormView.extend({ }, setDimensions: function(){ - this.$width.unitVal( Number(this.scenery.dimensions.a * this.scenery.scale) || "" ) - this.$height.unitVal( Number(this.scenery.dimensions.b * this.scenery.scale) || "" ) + if (! this.scenery) return + this.$width.unitVal( Number(this.scenery.naturalDimensions.a * this.scenery.scale) || "" ) + this.$height.unitVal( Number(this.scenery.naturalDimensions.b * this.scenery.scale) || "" ) }, changeWidth: function(e){ e.stopPropagation() - this.scenery.set_scale( this.$width.unitVal() / this.scenery.dimensions.a ) + this.scenery.set_scale( this.$width.unitVal() / this.scenery.naturalDimensions.a ) this.setDimensions() }, changeHeight: function(e){ e.stopPropagation() - this.scenery.set_scale( this.$height.unitVal() / this.scenery.dimensions.b ) + this.scenery.set_scale( this.$height.unitVal() / this.scenery.naturalDimensions.b ) this.setDimensions() }, changeUnits: function(){ @@ -137,11 +138,13 @@ var MediaEditor = FormView.extend({ bind: function(scenery){ this.scenery = scenery this.scenery.mx.bound = true + this.scenery.mx.el.classList.add("picked") }, unbind: function(){ if (this.scenery && this.scenery.mx) { this.scenery.mx.bound = false + this.scenery.mx.el.classList.remove("picked") } this.scenery = null }, |
