summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/editor/TextEditor.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2014-11-13 11:47:49 -0500
committerJules Laplace <jules@okfoc.us>2014-11-13 11:47:49 -0500
commit7456aa11d781c6758de7b46ec74c07cd02ce30e4 (patch)
tree21051ac08e67da494a739d200aab0cfd67edd7a0 /public/assets/javascripts/ui/editor/TextEditor.js
parent55b613565f05366e7ab0e77ee6a13931c6e86f4e (diff)
parent3ab0c6c24b95552feb111b647205cc92c3ca170c (diff)
merge
Diffstat (limited to 'public/assets/javascripts/ui/editor/TextEditor.js')
-rw-r--r--public/assets/javascripts/ui/editor/TextEditor.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/public/assets/javascripts/ui/editor/TextEditor.js b/public/assets/javascripts/ui/editor/TextEditor.js
index 51077af..2949943 100644
--- a/public/assets/javascripts/ui/editor/TextEditor.js
+++ b/public/assets/javascripts/ui/editor/TextEditor.js
@@ -25,6 +25,11 @@ var TextEditor = FormView.extend({
this.$fontSize = this.$("[name=font-size]")
this.$textBody = this.$("[name=text-body]")
this.$textAlign = this.$("[name=text-align]")
+
+ app.on("cancel-scenery", function(){
+ this.createMode(true)
+ $("body").toggleClass("addText", false)
+ }.bind(this))
},
toggle: function(state){
@@ -70,11 +75,13 @@ var TextEditor = FormView.extend({
if (this.tainted) {
Minotaur.watch( app.router.editorView.settings )
}
-
if (this.scenery.mx) {
this.scenery.mx.bound = false
this.scenery.mx.el.classList.remove("picked")
}
+ if (! this.scenery.media || ! this.scenery.media.description || this.scenery.media.description == "") {
+ this.scenery.remove()
+ }
}
this.tainted = false
this.scenery = null
@@ -138,6 +145,7 @@ var TextEditor = FormView.extend({
destroy: function(){
this.tainted = false
this.scenery.remove()
+ this.hide()
},
})