diff options
| author | yo mama <pepper@scannerjammer.com> | 2014-12-02 15:39:57 -0800 |
|---|---|---|
| committer | yo mama <pepper@scannerjammer.com> | 2014-12-02 15:39:57 -0800 |
| commit | a6f58439c639e0bb390180f67675e87b6a3ece21 (patch) | |
| tree | e39a4564065b4dd41f46d6ec095e9989c72278f3 /ModalView.js | |
first
Diffstat (limited to 'ModalView.js')
| -rw-r--r-- | ModalView.js | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/ModalView.js b/ModalView.js new file mode 100644 index 0000000..b2f4c70 --- /dev/null +++ b/ModalView.js @@ -0,0 +1,51 @@ + +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() + } + } + +}) + |
