var ModalView = View.extend({ events: { "click .close": 'close', }, initialize: function(opt){ if (opt && opt.parent) { this.parent = opt.parent } }, show: function(){ $(".mediaDrawer").removeClass("active"); this.$el.addClass("active"); $("body").addClass("noOverflow"); }, hide: function(){ // $(".mediaDrawer, .room1").removeClass("active editing"); 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() } } })