diff options
Diffstat (limited to 'public/assets/javascripts/ui')
| -rw-r--r-- | public/assets/javascripts/ui/_router.js | 1 | ||||
| -rw-r--r-- | public/assets/javascripts/ui/builder/BuilderInfo.js | 13 | ||||
| -rw-r--r-- | public/assets/javascripts/ui/editor/Presets.js | 11 | ||||
| -rw-r--r-- | public/assets/javascripts/ui/lib/UploadView.js | 4 |
4 files changed, 18 insertions, 11 deletions
diff --git a/public/assets/javascripts/ui/_router.js b/public/assets/javascripts/ui/_router.js index 794079e..bda0960 100644 --- a/public/assets/javascripts/ui/_router.js +++ b/public/assets/javascripts/ui/_router.js @@ -212,7 +212,6 @@ var SiteRouter = Router.extend({ // this.documentModal.destroy(name) }, - testWallpaper: function(e){ var content = document.getElementById("content") content.style.width = "680px" diff --git a/public/assets/javascripts/ui/builder/BuilderInfo.js b/public/assets/javascripts/ui/builder/BuilderInfo.js index 67834e7..c708275 100644 --- a/public/assets/javascripts/ui/builder/BuilderInfo.js +++ b/public/assets/javascripts/ui/builder/BuilderInfo.js @@ -10,8 +10,10 @@ var BuilderInfo = View.extend({ "change [name=width]": 'changeWidth', "change [name=depth]": 'changeDepth', "change [name=height]": 'changeHeight', + "keydown [name=width]": 'enterWidth', + "keydown [name=depth]": 'enterDepth', + "keydown [name=height]": 'enterHeight', "change [name=units]": 'changeUnits', - "change [name=resolution]": 'changeResolution', "change [name=viewHeight]": 'changeViewHeight', "click [data-role=destroy-room]": 'destroy', }, @@ -85,16 +87,25 @@ var BuilderInfo = View.extend({ this.hide() }, + enterWidth: function(e){ + if (e.keyCode == 13) this.changeWidth(e) + }, changeWidth: function(e){ e.stopPropagation() this.room.rect.x.setLength( this.$width.unitVal() ) Rooms.rebuild() }, + enterDepth: function(e){ + if (e.keyCode == 13) this.changeDepth(e) + }, changeDepth: function(e){ e.stopPropagation() this.room.rect.y.setLength( this.$depth.unitVal() ) Rooms.rebuild() }, + enterHeight: function(e){ + if (e.keyCode == 13) this.changeHeight(e) + }, changeHeight: function(e){ e.stopPropagation() this.room.height = this.$height.unitVal() diff --git a/public/assets/javascripts/ui/editor/Presets.js b/public/assets/javascripts/ui/editor/Presets.js index be86af3..ab311ef 100644 --- a/public/assets/javascripts/ui/editor/Presets.js +++ b/public/assets/javascripts/ui/editor/Presets.js @@ -84,15 +84,12 @@ var Presets = View.extend({ this.parent.colorControl.modes.forEach(function(mode){ if (! preset[mode].length) { Walls.setWallpaper[mode](preset[mode]) - Walls.setColor[mode](preset[mode].color) } else { - if (preset[mode].length) { - Walls.clearWallpaper[mode]() - } - Walls.setColor[mode](preset[mode]) - this.parent.colorControl.$swatch[ mode ].css("background-color", rgb_string(preset[mode])) - } + Walls.clearWallpaper[mode]() + } + Walls.setColor[mode](preset[mode]) + this.parent.colorControl.$swatch[ mode ].css("background-color", rgb_string(preset[mode])) }.bind(this)) this.parent.colorControl.setMode(preset.wall.color ? "wall" : "floor") Walls.setBodyColor() diff --git a/public/assets/javascripts/ui/lib/UploadView.js b/public/assets/javascripts/ui/lib/UploadView.js index efaa8c9..2d2c2c7 100644 --- a/public/assets/javascripts/ui/lib/UploadView.js +++ b/public/assets/javascripts/ui/lib/UploadView.js @@ -4,12 +4,12 @@ var UploadView = View.extend({ // define uploadAction events: { - "change .file": "handleFileSelect", + "change [type=file]": "handleFileSelect", "submit form": "preventDefault", }, initialize: function(){ - this.$file = this.$(".file") + this.$file = this.$("[type=file]") this.$upload = this.$(".upload-icon") }, |
