diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-08-26 14:12:52 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-08-26 14:12:52 -0400 |
| commit | fa1b3141216debeb0e334b1b2f94cbc50c52ccb9 (patch) | |
| tree | 62e6fffc2814c21b08e23c30386d19d9d78b34e0 /public/assets/javascripts/ui/editor/MediaEditor.js | |
| parent | 9bd30008c165fdb561f574dd2f83c35e609c96b1 (diff) | |
update size fields as you resize
Diffstat (limited to 'public/assets/javascripts/ui/editor/MediaEditor.js')
| -rw-r--r-- | public/assets/javascripts/ui/editor/MediaEditor.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/public/assets/javascripts/ui/editor/MediaEditor.js b/public/assets/javascripts/ui/editor/MediaEditor.js index f1ded50..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(){ |
