From c8bfd290434ab06cd6b8b1536b9c317eba7e6630 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 29 Sep 2014 17:33:18 -0400 Subject: if no media, dont show “delete media” button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/javascripts/ui/editor/EditorSettings.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'public/assets/javascripts/ui/editor/EditorSettings.js') diff --git a/public/assets/javascripts/ui/editor/EditorSettings.js b/public/assets/javascripts/ui/editor/EditorSettings.js index de47be4..f74b535 100644 --- a/public/assets/javascripts/ui/editor/EditorSettings.js +++ b/public/assets/javascripts/ui/editor/EditorSettings.js @@ -17,8 +17,8 @@ var EditorSettings = FormView.extend({ }, initialize: function(opt){ - this.parent = opt.parent - this.__super__.initialize.call(this) + this.parent = opt.parent + this.__super__.initialize.call(this) this.$id = this.$("[name=_id]") this.$csrf = this.$("[name=_csrf]") @@ -110,7 +110,6 @@ var EditorSettings = FormView.extend({ var state = typeof state == 'boolean' ? state : ! this.$el.hasClass("active") this.$el.toggleClass("active", state) - $(".inuse").removeClass("inuse") $("[data-role='toggle-project-settings']").toggleClass("inuse", state) }, @@ -183,6 +182,8 @@ var EditorSettings = FormView.extend({ window.history.pushState(null, document.title, "/project/" + data.slug + "/edit") this.parent.data = data + + this.toggle(false) }, }) -- cgit v1.2.3-70-g09d2