var ModalView = View.extend({ events: { "click .close": 'close', }, initialize: function(opt){ if (opt && opt.parent) { this.parent = opt.parent } }, usesFileUpload: false, show: function(){ $(".mediaDrawer").removeClass("active") if (! this.usesFileUpload) { $(".fileUpload").removeClass("active") } if (this.fixedClose) { $("#fixed_close").addClass("active") $("#fixed_close").bind("click", this.hide.bind(this)) } this.$el.addClass("active") $("body").addClass("noOverflow") }, hide: function(){ // $(".mediaDrawer, .room1").removeClass("active editing"); if (this.fixedClose) { $("#fixed_close").removeClass("active") $("#fixed_close").unbind("click", this.hide.bind(this)) } this.$el.removeClass("active"); $("body").removeClass("noOverflow"); }, close: function(){ if (window.isModalView) { window.location.pathname = "/" } else { history.pushState(null, document.title, app.router.originalPath) this.hide() } } })