summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/editor/EditorSettings.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2014-12-01 12:43:28 -0500
committerJules Laplace <jules@okfoc.us>2014-12-01 12:43:28 -0500
commitf9be43e4cce6b57f41a4e2242f019e969b081d37 (patch)
tree721e26ba5cbbc1a67fb3d04598a8d77760d03fe3 /public/assets/javascripts/ui/editor/EditorSettings.js
parent6f7f0ac032193215223787ca69717fcb478f12ac (diff)
view project button in settings
Diffstat (limited to 'public/assets/javascripts/ui/editor/EditorSettings.js')
-rw-r--r--public/assets/javascripts/ui/editor/EditorSettings.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/public/assets/javascripts/ui/editor/EditorSettings.js b/public/assets/javascripts/ui/editor/EditorSettings.js
index 026607a..b319404 100644
--- a/public/assets/javascripts/ui/editor/EditorSettings.js
+++ b/public/assets/javascripts/ui/editor/EditorSettings.js
@@ -18,6 +18,7 @@ var EditorSettings = FormView.extend({
"click [data-role='clear-project']": 'clear',
"click [data-role='destroy-project']": 'destroy',
"click [data-role='toggle-map']": 'toggleMap',
+ "click [data-role='view-project']": 'viewProject',
"click #startText": "setStartPosition",
"click #moveText": "confirmStartPosition",
"click #confirmText": "setStartPosition",
@@ -217,11 +218,25 @@ var EditorSettings = FormView.extend({
this.isVisible = true
},
+ viewAfterSave: false,
+ viewProject: function(e){
+ e.preventDefault()
+ Minotaur.unwatch(this)
+ Minotaur.hide()
+ this.viewAfterSave = true
+ this.save()
+ },
+
success: function(data){
this.$id.val(data._id)
this.$name.val(data.name)
this.action = this.updateAction
+ if (this.viewAfterSave) {
+ window.location.pathname = "/project/" + data.slug
+ return
+ }
+
Minotaur.unwatch(this)
Minotaur.hide()