summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/lib/ModalView.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2016-10-28 18:06:46 -0400
committerJules Laplace <jules@okfoc.us>2016-10-28 18:06:46 -0400
commit9e7bacd46c1e5d0e1c24433690d421ab3f3a11f2 (patch)
tree4d0cefa2780dfa4382f1ed2ea481b6aafbdbb15e /public/assets/javascripts/ui/lib/ModalView.js
parent50da9e3e677f121f15e501bf062da6c45db255ad (diff)
parentcce1dea756717f1308c6b72f762b5ea5f5b43958 (diff)
merge
Diffstat (limited to 'public/assets/javascripts/ui/lib/ModalView.js')
-rw-r--r--public/assets/javascripts/ui/lib/ModalView.js79
1 files changed, 45 insertions, 34 deletions
diff --git a/public/assets/javascripts/ui/lib/ModalView.js b/public/assets/javascripts/ui/lib/ModalView.js
index d9b518a..e0070ce 100644
--- a/public/assets/javascripts/ui/lib/ModalView.js
+++ b/public/assets/javascripts/ui/lib/ModalView.js
@@ -1,42 +1,53 @@
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")
- }
-
- this.$el.addClass("active")
+ events: {
+ "click .close": 'close',
+ },
+
+ initialize: function(opt){
+ if (opt && opt.parent) {
+ this.parent = opt.parent
+ }
+ },
+
+ usesFileUpload: false,
+
+ show: function(){
+ $(".mediaDrawer").removeClass("active")
+ $(".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(){
+ hide: function(){
// $(".mediaDrawer, .room1").removeClass("active editing");
- this.$el.removeClass("active");
+ 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()
- }
- }
+ },
+
+ hideClose: function(){
+ $("#fixed_close").removeClass("active")
+ $("#fixed_close").unbind("click", this.hide.bind(this))
+ },
+
+ close: function(){
+ if (window.isModalView) {
+ window.location.pathname = "/"
+ }
+ else {
+ history.pushState(null, document.title, app.router.originalPath)
+ this.hide()
+ }
+ }
})