summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/ModalView.js
blob: 80ce8d0fcef793a80ae266f59f1b93efde0d3e2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
var ModalView = View.extend({
	events: {
		"click .close": 'close',
	},
	
	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.master.originalPath)
			this.hide()
		}
	}
})