first commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
var $j = jQuery.noConflict();
|
||||
|
||||
$j( document ).ready( function() {
|
||||
"use strict";
|
||||
// Edd display cart
|
||||
oceanwpEDDCartDetails();
|
||||
} );
|
||||
|
||||
/* ==============================================
|
||||
Easy Digital Downloads Cart Details
|
||||
============================================== */
|
||||
function oceanwpEDDCartDetails() {
|
||||
"use strict"
|
||||
/**
|
||||
* EDD cart information in the header
|
||||
*/
|
||||
var cartTotalAmount = $j('.eddmenucart-details.total');
|
||||
|
||||
$j('body').on('edd_cart_item_added', function( event, response ) {
|
||||
|
||||
$j( '.edd-menu-icon' ).removeClass('edd-cart-empty');
|
||||
|
||||
cartTotalAmount.html( response.total );
|
||||
|
||||
});
|
||||
|
||||
$j('body').on('edd_cart_item_removed', function( event, response ) {
|
||||
|
||||
cartTotalAmount.html( response.total );
|
||||
});
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
var $j=jQuery.noConflict();function oceanwpEDDCartDetails(){"use strict";var a=$j(".eddmenucart-details.total");$j("body").on("edd_cart_item_added",function(t,e){$j(".edd-menu-icon").removeClass("edd-cart-empty"),a.html(e.total)}),$j("body").on("edd_cart_item_removed",function(t,e){a.html(e.total)})}$j(document).ready(function(){"use strict";oceanwpEDDCartDetails()});
|
||||
@@ -0,0 +1,53 @@
|
||||
var $j = jQuery.noConflict();
|
||||
|
||||
$j( document ).ready( function() {
|
||||
"use strict";
|
||||
// Edd display cart
|
||||
oceanwpEddDisplayCart();
|
||||
} );
|
||||
|
||||
/* ==============================================
|
||||
EddCOMMERCE DISPLAY CART
|
||||
============================================== */
|
||||
function oceanwpEddDisplayCart() {
|
||||
"use strict"
|
||||
|
||||
var $overlay = $j( '.owp-cart-overlay' );
|
||||
|
||||
$j( 'body' ).on( 'edd_cart_item_added', function() {
|
||||
$overlay.fadeIn();
|
||||
$j( 'body' ).addClass( 'show-cart' );
|
||||
|
||||
// Close quick view modal if enabled
|
||||
var qv_modal = $j( '#owp-qv-wrap' ),
|
||||
qv_content = $j( '#owp-qv-content' );
|
||||
|
||||
if ( qv_modal.length ) {
|
||||
$j( 'html' ).css( {
|
||||
'overflow': '',
|
||||
'margin-right': ''
|
||||
} );
|
||||
$j( 'html' ).removeClass( 'owp-qv-open' );
|
||||
|
||||
qv_modal.fadeOut();
|
||||
qv_modal.removeClass( 'is-visible' );
|
||||
|
||||
setTimeout( function() {
|
||||
qv_content.html( '' );
|
||||
}, 600);
|
||||
}
|
||||
} );
|
||||
|
||||
$overlay.on( 'click', function() {
|
||||
console.log("clicked");
|
||||
$j( this ).fadeOut();
|
||||
$j( 'body' ).removeClass( 'show-cart' );
|
||||
} );
|
||||
|
||||
// Close on resize to avoid conflict
|
||||
$j( window ).resize( function() {
|
||||
$overlay.fadeOut();
|
||||
$j( 'body' ).removeClass( 'show-cart' );
|
||||
} );
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
var $j=jQuery.noConflict();function oceanwpEddDisplayCart(){"use strict";var t=$j(".owp-cart-overlay");$j("body").on("edd_cart_item_added",function(){t.fadeIn(),$j("body").addClass("show-cart");var o=$j("#owp-qv-wrap"),e=$j("#owp-qv-content");o.length&&($j("html").css({overflow:"","margin-right":""}),$j("html").removeClass("owp-qv-open"),o.fadeOut(),o.removeClass("is-visible"),setTimeout(function(){e.html("")},600))}),t.on("click",function(){console.log("clicked"),$j(this).fadeOut(),$j("body").removeClass("show-cart")}),$j(window).resize(function(){t.fadeOut(),$j("body").removeClass("show-cart")})}$j(document).ready(function(){"use strict";oceanwpEddDisplayCart()});
|
||||
Reference in New Issue
Block a user