summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/blueprint/BlueprintNotice.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-08-26 17:17:50 -0400
committerJules Laplace <jules@okfoc.us>2015-08-26 17:21:10 -0400
commita54c08b70c6072f6c2da48bc209a8b915c993a97 (patch)
tree6bf43fe482737aa0eaa5cae1e88689a253e66be8 /public/assets/javascripts/ui/blueprint/BlueprintNotice.js
parent8ce3e6347b75a653ed3b7e4e3b2be5f23c841e97 (diff)
set default start position on blueprint
Diffstat (limited to 'public/assets/javascripts/ui/blueprint/BlueprintNotice.js')
-rw-r--r--public/assets/javascripts/ui/blueprint/BlueprintNotice.js42
1 files changed, 42 insertions, 0 deletions
diff --git a/public/assets/javascripts/ui/blueprint/BlueprintNotice.js b/public/assets/javascripts/ui/blueprint/BlueprintNotice.js
index bced4e1..4b799a6 100644
--- a/public/assets/javascripts/ui/blueprint/BlueprintNotice.js
+++ b/public/assets/javascripts/ui/blueprint/BlueprintNotice.js
@@ -2,9 +2,14 @@ var BlueprintNotice = View.extend(ToggleableView.prototype).extend({
el: "#blueprintNotice",
+ events: {
+ "click .next": "next",
+ },
+
initialize: function(opt){
this.parent = opt.parent
this.$notice = this.$(".notice")
+ this.$next = this.$(".next")
},
notice: function(msg){
@@ -14,7 +19,44 @@ var BlueprintNotice = View.extend(ToggleableView.prototype).extend({
showCreateProjectNotice: function(){
this.notice("<a href='/project/blueprint/" + this.parent.data.slug +
"'>Start a new project</a> with this blueprint.")
+ this.$next.hide()
+ this.nextFn = null
+ this.show()
+ },
+
+ showStartPositionNotice: function(){
+ this.parent.settings.hide()
+ this.notice("First, click the map to set the starting location.")
+ this.$next.show().html("Next")
+ this.show()
+ this.nextFn = this.showStartAngleNotice.bind(this)
+ },
+
+ showStartAngleNotice: function(){
+ this.parent.settings.hide()
+ this.notice("Next, rotate the camera to the desired orientation.")
+ this.$next.show().html("Done")
this.show()
+ this.nextFn = this.doneSettingPosition.bind(this)
+ this.parent.toolbar.toggleOrbitMode(false)
+ },
+
+ doneSettingPosition: function(){
+ this.nextFn = null
+ this.$next.hide()
+ this.hide()
+ this.parent.settings.show()
+ this.parent.startPosition.rotationX = cam.rotationX
+ this.parent.startPosition.rotationY = cam.rotationY
+ this.parent.toolbar.toggleOrbitMode(true)
+ this.parent.toolbar.orthoPolylineMode()
+ },
+
+ nextFn: null,
+ next: function(){
+ if (this.nextFn) {
+ this.nextFn()
+ }
},
}) \ No newline at end of file