diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-12-01 12:43:28 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-12-01 12:43:28 -0500 |
| commit | f9be43e4cce6b57f41a4e2242f019e969b081d37 (patch) | |
| tree | 721e26ba5cbbc1a67fb3d04598a8d77760d03fe3 /public/assets/javascripts/ui/editor/EditorSettings.js | |
| parent | 6f7f0ac032193215223787ca69717fcb478f12ac (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.js | 15 |
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() |
