summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/editor
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-04-27 20:47:41 -0400
committerJules Laplace <jules@okfoc.us>2015-04-27 21:17:48 -0400
commit53695472cfb20b730d04b2d6a6a16c6d281e9180 (patch)
treef257932e5219e59bdd3885e360dc03fb3507bb42 /public/assets/javascripts/ui/editor
parent90b0e89b4dabf67035ae4bccdb02c52da4e31ab1 (diff)
outline box
Diffstat (limited to 'public/assets/javascripts/ui/editor')
-rw-r--r--public/assets/javascripts/ui/editor/SculptureEditor.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/public/assets/javascripts/ui/editor/SculptureEditor.js b/public/assets/javascripts/ui/editor/SculptureEditor.js
index 52663e1..953260c 100644
--- a/public/assets/javascripts/ui/editor/SculptureEditor.js
+++ b/public/assets/javascripts/ui/editor/SculptureEditor.js
@@ -17,6 +17,7 @@ var SculptureEditor = FormView.extend({
"change [name=mute]": "setMute",
"change [name=width]": 'changeWidth',
"change [name=height]": 'changeHeight',
+ "change [name=depth]": 'changeDepth',
"change [name=units]": 'changeUnits',
"click [data-role=destroy-sculpture]": "destroy",
},
@@ -35,6 +36,7 @@ var SculptureEditor = FormView.extend({
// image fields
this.$width = this.$("[name=width]")
this.$height = this.$("[name=height]")
+ this.$depth = this.$("[name=depth]")
this.$units = this.$("[name=units]")
// video fields
@@ -168,17 +170,26 @@ var SculptureEditor = FormView.extend({
if (! this.sculpture) return
this.$width.unitVal( Number(this.sculpture.naturalDimensions.a * this.sculpture.scale) || "" )
this.$height.unitVal( Number(this.sculpture.naturalDimensions.b * this.sculpture.scale) || "" )
+ this.$depth.unitVal( Number(this.sculpture.naturalDimensions.c * this.sculpture.scale) || "" )
this.tainted = true
},
changeWidth: function(e){
e.stopPropagation()
this.sculpture.set_scale( this.$width.unitVal() / this.sculpture.naturalDimensions.a )
this.setDimensions()
+ this.sculpture.updateOutline()
},
changeHeight: function(e){
e.stopPropagation()
this.sculpture.set_scale( this.$height.unitVal() / this.sculpture.naturalDimensions.b )
this.setDimensions()
+ this.sculpture.updateOutline()
+ },
+ changeDepth: function(e){
+ e.stopPropagation()
+ this.sculpture.set_depth( this.$depth.unitVal() )
+ this.$depth.unitVal( Number(this.sculpture.naturalDimensions.c * this.sculpture.scale) || "" )
+ this.sculpture.updateOutline()
},
changeUnits: function(){
app.units = this.$units.val()