first commit
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
(function ($) {
|
||||
'use strict';
|
||||
|
||||
// float cart
|
||||
|
||||
var $myDiv = $('.woo-float-info');
|
||||
if ($myDiv.length) {
|
||||
$(window).scroll(function () {
|
||||
var distanceTop = $('.woocommerce div.product form.cart').offset().top - 60;
|
||||
|
||||
if ($(window).scrollTop() > distanceTop)
|
||||
$myDiv.animate({'bottom': '0'}, 200);
|
||||
else
|
||||
$myDiv.stop(true).animate({'bottom': '-400px'}, 100);
|
||||
});
|
||||
|
||||
$('.woo-float-info .close-me').bind('click', function () {
|
||||
$(this).parent().remove();
|
||||
});
|
||||
};
|
||||
|
||||
// return to top button
|
||||
// ===== Scroll to Top ====
|
||||
$(window).scroll(function () {
|
||||
if ($(this).scrollTop() >= 50) { // If page is scrolled more than 50px
|
||||
$('#return-to-top').fadeIn(200); // Fade in the arrow
|
||||
} else {
|
||||
$('#return-to-top').fadeOut(200); // Else fade out the arrow
|
||||
}
|
||||
});
|
||||
$('#return-to-top').click(function () { // When arrow is clicked
|
||||
$('body,html').animate({
|
||||
scrollTop: 0 // Scroll to top of body
|
||||
}, 500);
|
||||
});
|
||||
$(document).ready(function(){
|
||||
$('.e-notice-bar__action a').attr('href','').attr('href','http://localhost/enwoo/');
|
||||
});
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,148 @@
|
||||
jQuery( document ).ready( function ( $ ) {
|
||||
|
||||
// Let's use the API.
|
||||
var api = wp.customize;
|
||||
|
||||
syncPreviewButtons();
|
||||
|
||||
/**
|
||||
* Sync device preview button from WordPress to WPBF and vice versa.
|
||||
*/
|
||||
function syncPreviewButtons() {
|
||||
// Bind device changes from WordPress default.
|
||||
api.previewedDevice.bind( function ( newDevice ) {
|
||||
envoResponsivePreview( newDevice );
|
||||
} );
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup WPBF device preview.
|
||||
*
|
||||
* @param string device The device (mobile, tablet, or desktop).
|
||||
* @param bool modifyOverlay Whether or not to modify the wp-full-overlay.
|
||||
*/
|
||||
function envoResponsivePreview( device ) {
|
||||
$( '.envo-responsive-options button' ).removeClass( 'active' );
|
||||
$( '.envo-responsive-options .preview-' + device ).addClass( 'active' );
|
||||
$( '.envo-control-device' ).removeClass( 'active' );
|
||||
$( '.envo-control-' + device ).addClass( 'active' );
|
||||
//$(".control-section li[id*='"+device+"']").addClass('active');
|
||||
}
|
||||
|
||||
// Display desktop control by default.
|
||||
$( ".control-section li[id*='desktop']" ).addClass( 'envo-control-device' ).addClass( 'envo-control-desktop' );
|
||||
$( ".control-section li[id*='tablet']" ).addClass( 'envo-control-device' ).addClass( 'envo-control-tablet' );
|
||||
$( ".control-section li[id*='mobile']" ).addClass( 'envo-control-device' ).addClass( 'envo-control-mobile' );
|
||||
//$( '.envo-control-desktop' ).addClass( 'active' );
|
||||
|
||||
|
||||
// Loop through envo device buttons and assign the event.
|
||||
$( '.envo-responsive-options button' ).on( 'click', function ( e ) {
|
||||
var device = this.getAttribute( 'data-device' );
|
||||
|
||||
envoResponsivePreview( device );
|
||||
// Trigger WordPress device event.
|
||||
api.previewedDevice.set( device );
|
||||
} );
|
||||
|
||||
} );
|
||||
|
||||
jQuery( document ).ready( function ( $ ) {
|
||||
|
||||
// Let's use the API.
|
||||
var api = wp.customize;
|
||||
|
||||
syncPreviewButtons();
|
||||
|
||||
/**
|
||||
* Sync device preview button from WordPress to WPBF and vice versa.
|
||||
*/
|
||||
function syncPreviewButtons() {
|
||||
// Bind device changes from WordPress default.
|
||||
api.previewedDevice.bind( function ( newDevice ) {
|
||||
envoResponsivePreview( newDevice );
|
||||
} );
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup WPBF device preview.
|
||||
*
|
||||
* @param string device The device (mobile, tablet, or desktop).
|
||||
* @param bool modifyOverlay Whether or not to modify the wp-full-overlay.
|
||||
*/
|
||||
function envoResponsivePreview( device ) {
|
||||
$( '.envo-responsive-options' ).removeClass( 'active' );
|
||||
$( '.envo-responsive-options.preview-' + device ).addClass( 'active' );
|
||||
$( '.customize-control-kirki-radio-buttonset' ).find( "input[value='" + device + "']" ).prop( "checked", true );
|
||||
}
|
||||
|
||||
// Display desktop control by default.
|
||||
//$( '.preview-desktop' ).addClass( 'active' );
|
||||
|
||||
// Loop through envo device buttons and assign the event.
|
||||
$( '.switch-label' ).on( 'click', function ( e ) {
|
||||
var device = $( '.envo-responsive-options' ).getAttribute( 'data-device' );
|
||||
|
||||
envoResponsivePreview( device );
|
||||
// Trigger WordPress device event.
|
||||
api.previewedDevice.set( device );
|
||||
} );
|
||||
|
||||
} );
|
||||
|
||||
jQuery( document ).ready( function ( $ ) {
|
||||
|
||||
// Let's use the API.
|
||||
var api = wp.customize;
|
||||
|
||||
// on each click of the new element, we toggle the wrapper element to show or hide
|
||||
$( '.show-kirki-control.dashicons-edit' ).click( function ( e ) {
|
||||
$( '.envo-control-desktop' ).removeClass( 'active' );
|
||||
// we go 2 parents up, to find the '.customize-control-kirki-custom' element, and toggle it
|
||||
$( this ).parents().eq( 2 ).nextUntil( '.customize-control-kirki-custom' ).toggleClass( 'active' ).toggleClass('activated');
|
||||
$( '.envo-control-tablet' ).removeClass( 'active' );
|
||||
$( '.envo-control-mobile' ).removeClass( 'active' );
|
||||
// toggle the devices buttons
|
||||
$( this ).prev().toggle();
|
||||
// set desktop as default
|
||||
api.previewedDevice.set( 'desktop' );
|
||||
|
||||
// switch classes to display '+' and '-' dashicons
|
||||
$( e.target ).toggleClass( 'dashicons-edit dashicons-minus' );
|
||||
|
||||
// prevent default behaviour if element is clicked (page jump)
|
||||
e.preventDefault();
|
||||
} );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// add collapse feature to 'typography' and 'spacing' controls
|
||||
var controlClasses = '.customize-control-kirki-typography, .customize-control-kirki-spacing';
|
||||
|
||||
|
||||
// hide all '.wrapper' instances inside the above defined controls
|
||||
$( controlClasses ).find( '.wrapper' ).hide();
|
||||
|
||||
// prepend a new '<span>' element to the control-label
|
||||
$( controlClasses ).find( '.customize-control-title' ).prepend( '<span class="show-kirki-control dashicons dashicons-plus"></span> ' );
|
||||
|
||||
|
||||
|
||||
// on each click of the new element, we toggle the wrapper element to show or hide
|
||||
$( controlClasses ).find( '.customize-control-title' ).click( function ( e ) {
|
||||
|
||||
// we go 2 parents up, to find the '.wrapper' element, and toggle it
|
||||
$( this ).parents().eq( 1 ).find( '.wrapper' ).slideToggle( 'fast' );
|
||||
|
||||
// switch classes to display '+' and '-' dashicons
|
||||
$( this ).find( '.show-kirki-control' ).toggleClass( 'dashicons-plus dashicons-minus' );
|
||||
|
||||
// prevent default behaviour if element is clicked (page jump)
|
||||
e.preventDefault();
|
||||
} );
|
||||
} );
|
||||
|
||||
Reference in New Issue
Block a user