Skip to content
Snippets Groups Projects
Commit 1c92432b authored by Chris Hallberg's avatar Chris Hallberg
Browse files

Switched from and removed Lightbox permanent close actions in favor of BS events.

parent d6727a3b
No related merge requests found
...@@ -249,7 +249,7 @@ $(document).ready(function() { ...@@ -249,7 +249,7 @@ $(document).ready(function() {
}); });
return false; return false;
}); });
Lightbox.addCloseAction(function() { $('#modal').on('hidden', function(e) {
// Update cart items (add to cart, remove from cart, cart lightbox interface) // Update cart items (add to cart, remove from cart, cart lightbox interface)
var cartCount = $('#cartItems strong'); var cartCount = $('#cartItems strong');
if(cartCount.length > 0) { if(cartCount.length > 0) {
......
...@@ -13,7 +13,6 @@ var Lightbox = { ...@@ -13,7 +13,6 @@ var Lightbox = {
XHR: false, // Used for current in-progress XHR lightbox request XHR: false, // Used for current in-progress XHR lightbox request
openStack: [], // Array of functions to be called after changeContent or the lightbox event 'shown' openStack: [], // Array of functions to be called after changeContent or the lightbox event 'shown'
closeStack: [], // Array of functions to be called and cleared after the lightbox event 'hidden' closeStack: [], // Array of functions to be called and cleared after the lightbox event 'hidden'
closeStackPerm: [],// Array of functions to be called after the lightbox event 'hidden'
formHandlers: [], // Full custom handlers for forms; by name formHandlers: [], // Full custom handlers for forms; by name
formCallbacks: [], // Custom functions for forms, called after .submit(); by name formCallbacks: [], // Custom functions for forms, called after .submit(); by name
...@@ -45,12 +44,6 @@ var Lightbox = { ...@@ -45,12 +44,6 @@ var Lightbox = {
addCloseAction: function(func) { addCloseAction: function(func) {
this.closeStack.push(func); this.closeStack.push(func);
}, },
/**
* Register permanent close event handlers
*/
addPermanentCloseAction: function(func) {
this.closeStackPerm.push(func);
},
/** /**
* For when you want to handle that form all by yourself * For when you want to handle that form all by yourself
* *
......
...@@ -249,7 +249,7 @@ $(document).ready(function() { ...@@ -249,7 +249,7 @@ $(document).ready(function() {
}); });
return false; return false;
}); });
Lightbox.addPermanentCloseAction(function() { $('#modal').on('hidden.bs.modal', function() {
// Update cart items (add to cart, remove from cart, cart lightbox interface) // Update cart items (add to cart, remove from cart, cart lightbox interface)
var cartCount = $('#cartItems strong'); var cartCount = $('#cartItems strong');
if(cartCount.length > 0) { if(cartCount.length > 0) {
......
...@@ -13,7 +13,6 @@ var Lightbox = { ...@@ -13,7 +13,6 @@ var Lightbox = {
XHR: false, // Used for current in-progress XHR lightbox request XHR: false, // Used for current in-progress XHR lightbox request
openStack: [], // Array of functions to be called after changeContent or the lightbox event 'shown' openStack: [], // Array of functions to be called after changeContent or the lightbox event 'shown'
closeStack: [], // Array of functions to be called and cleared after the lightbox event 'hidden' closeStack: [], // Array of functions to be called and cleared after the lightbox event 'hidden'
closeStackPerm: [],// Array of functions to be called after the lightbox event 'hidden'
formHandlers: [], // Full custom handlers for forms; by name formHandlers: [], // Full custom handlers for forms; by name
formCallbacks: [], // Custom functions for forms, called after .submit(); by name formCallbacks: [], // Custom functions for forms, called after .submit(); by name
...@@ -45,12 +44,6 @@ var Lightbox = { ...@@ -45,12 +44,6 @@ var Lightbox = {
addCloseAction: function(func) { addCloseAction: function(func) {
this.closeStack.push(func); this.closeStack.push(func);
}, },
/**
* Register permanent close event handlers
*/
addPermanentCloseAction: function(func) {
this.closeStackPerm.push(func);
},
/** /**
* For when you want to handle that form all by yourself * For when you want to handle that form all by yourself
* *
...@@ -134,10 +127,6 @@ var Lightbox = { ...@@ -134,10 +127,6 @@ var Lightbox = {
closeActions: function() { closeActions: function() {
Lightbox.shown = false; Lightbox.shown = false;
Lightbox.openingURL = false; Lightbox.openingURL = false;
// permanent close actions
for(var i=Lightbox.closeStackPerm.length;i--;) {
Lightbox.closeStackPerm[i]();
}
// Clean out stack // Clean out stack
while(Lightbox.closeStack.length > 0) { while(Lightbox.closeStack.length > 0) {
var f = Lightbox.closeStack.pop(); var f = Lightbox.closeStack.pop();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment