summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/blueprint/BlueprintSettings.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-08-20 23:33:36 -0400
committerJules Laplace <jules@okfoc.us>2015-08-20 23:33:36 -0400
commit272474767b6ed1f419843c7a205c16f934eeb84f (patch)
tree5ff43f054a0d34d3698de893a26b9e5b24bce424 /public/assets/javascripts/ui/blueprint/BlueprintSettings.js
parent4ead3876f33036a94c0e5f7671df3f1f6d148400 (diff)
turn segments into rects
Diffstat (limited to 'public/assets/javascripts/ui/blueprint/BlueprintSettings.js')
-rw-r--r--public/assets/javascripts/ui/blueprint/BlueprintSettings.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/public/assets/javascripts/ui/blueprint/BlueprintSettings.js b/public/assets/javascripts/ui/blueprint/BlueprintSettings.js
index acd8dcc..252e3f1 100644
--- a/public/assets/javascripts/ui/blueprint/BlueprintSettings.js
+++ b/public/assets/javascripts/ui/blueprint/BlueprintSettings.js
@@ -1,5 +1,5 @@
-var BlueprintSettings = FormView.extend({
+var BlueprintSettings = FormView.extend(ToggleableView.prototype).extend({
el: "#blueprintSettings",
action: "/api/blueprint/edit",
@@ -25,7 +25,13 @@ var BlueprintSettings = FormView.extend({
load: function(data){
this.$id.val(data._id)
- this.$name.val(data.name)
+ if (data.name) {
+ this.$name.val(data.name)
+ this.hide()
+ }
+ else {
+ this.$name.val("")
+ }
if (data.shapes) {
shapes.destroy()
shapes.deserialize( data.shapes )
@@ -51,10 +57,6 @@ var BlueprintSettings = FormView.extend({
}.bind(this))
},
- toggle: function(state){
- this.$el.toggleClass("active", state)
- },
-
enterSubmit: function (e) {
e.stopPropagation()
var base = this
@@ -105,6 +107,8 @@ var BlueprintSettings = FormView.extend({
this.$name.val(data.name)
this.action = this.updateAction
+ this.hide()
+
Minotaur.unwatch(this)
Minotaur.hide()