Initial Commit N° : 003 - V.4.3.5
This commit is contained in:
+106
-14
@@ -4,7 +4,7 @@ if (typeof _cookie_live === 'undefined') {
|
||||
var originalTitle = document.title;
|
||||
var notificationInterval;
|
||||
var currentMessageIndex = 0;
|
||||
var timeout_popup_static;
|
||||
var timeout_popup_static,timeout_box_shadow ;
|
||||
/* Document ready */
|
||||
jQuery(document).ready(function ($) {
|
||||
"use strict";
|
||||
@@ -284,7 +284,7 @@ jQuery(document).ready(function ($) {
|
||||
/**
|
||||
* For Checkout Page
|
||||
*/
|
||||
if ($('body').hasClass('woocommerce-checkout') || $('form.woocommerce-checkout').length) {
|
||||
if ($('body').hasClass('woocommerce-checkout') || $('form.woocommerce-checkout').length || $('#cart-sidebar').length <= 0) {
|
||||
var _href = $(this).attr('href');
|
||||
window.location.href = _href;
|
||||
|
||||
@@ -305,7 +305,7 @@ jQuery(document).ready(function ($) {
|
||||
$('body').trigger('nasa_cross_sell_columns_setting', [$('#cart-sidebar .cross-sells').find('.nasa-slick-slider')]);
|
||||
}
|
||||
|
||||
if ($('#cart-sidebar').length && !$('#cart-sidebar').hasClass('nasa-active')) {
|
||||
if (!$('#cart-sidebar').hasClass('nasa-active')) {
|
||||
|
||||
$('#cart-sidebar').addClass('nasa-active');
|
||||
|
||||
@@ -324,7 +324,7 @@ jQuery(document).ready(function ($) {
|
||||
}
|
||||
|
||||
$('body').trigger('nasa_opened_cart_sidebar');
|
||||
$('body').trigger('init_carousel_pro_empty_sidebar',[$('#cart-sidebar')]);
|
||||
$('body').trigger('init_carousel_pro_empty_sidebar', [$('#cart-sidebar')]);
|
||||
|
||||
if ($('.nasa-close-notice').length) {
|
||||
$('.nasa-close-notice').trigger('click');
|
||||
@@ -1091,7 +1091,7 @@ jQuery(document).ready(function ($) {
|
||||
|
||||
var url = window.location.origin + window.location.pathname;
|
||||
$(_wrap).html(data.content);
|
||||
var _current = $(_wrap).find('a[href="' + url + '"]:not(.logo)');
|
||||
var _current = $(_wrap).find('a[href="' + url + '"]:not(.logo)');
|
||||
var _svg = '<svg width="32" height="32" viewBox="0 0 22 32"><path d="M11.001 0.006c-5.889 0-10.663 4.775-10.663 10.663 0 1.945 0.523 3.762 1.432 5.332l9.23 15.994 9.23-15.994c0.909-1.57 1.432-3.387 1.432-5.332 0-5.888-4.774-10.663-10.662-10.663zM11.001 13.334c-1.472 0-2.666-1.193-2.666-2.665 0-1.471 1.194-2.665 2.666-2.665s2.665 1.194 2.665 2.665c0 1.472-1.193 2.665-2.665 2.665z" fill="currentColor"/></svg>';
|
||||
|
||||
if ($(_current).length) {
|
||||
@@ -1130,7 +1130,7 @@ jQuery(document).ready(function ($) {
|
||||
distance = 60;
|
||||
|
||||
// swipe horizontal to close
|
||||
$('body').on('touchstart', '#cart-sidebar, #nasa-wishlist-sidebar, #nasa-viewed-sidebar, #nasa-quickview-sidebar, #nasa-menu-sidebar-content, .nasa-top-cat-filter-wrap-mobile, .nasa-top-sidebar, .account-nav-wrap.vertical-tabs, .ns-sticky-scroll-sidebar', function (e) {
|
||||
$('body').on('touchstart', '#cart-sidebar, #nasa-wishlist-sidebar, #nasa-viewed-sidebar, #nasa-quickview-sidebar, #nasa-menu-sidebar-content, .nasa-top-cat-filter-wrap-mobile, .nasa-top-sidebar, .account-nav-wrap.vertical-tabs, .ns-sticky-scroll-sidebar, #vertical-menu-float.nasa-active', function (e) {
|
||||
touchstart = 0;
|
||||
if (!$(e.target).hasClass('slick-active') && !$(e.target).parents('.nasa-slick-slider').length) {
|
||||
touchstart = e.touches[0].clientX;
|
||||
@@ -1153,7 +1153,7 @@ jQuery(document).ready(function ($) {
|
||||
}
|
||||
});
|
||||
|
||||
$('body').on('touchmove', '#nasa-menu-sidebar-content, .nasa-top-cat-filter-wrap-mobile, .nasa-top-sidebar, .account-nav-wrap.vertical-tabs', function (e) {
|
||||
$('body').on('touchmove', '#nasa-menu-sidebar-content, .nasa-top-cat-filter-wrap-mobile, .nasa-top-sidebar, .account-nav-wrap.vertical-tabs, #vertical-menu-float.nasa-active', function (e) {
|
||||
touchend = e.changedTouches[0].clientX;
|
||||
|
||||
if (touchstart != touchend && touchstart != 0 && Math.abs(touchstart - touchend) > distance) {
|
||||
@@ -2338,15 +2338,16 @@ jQuery(document).ready(function ($) {
|
||||
* Login / Register Popup
|
||||
*/
|
||||
$('body').on('click', '.nasa-login-register-ajax', function () {
|
||||
if ($('#nasa-login-register-form').length <= 0) {
|
||||
var _content = $('#tmpl-nasa-register-form').html();
|
||||
$('.nasa-login-register-warper').html(_content);
|
||||
$('#tmpl-nasa-register-form').remove();
|
||||
if (!$('body').hasClass('logged-in')) {
|
||||
if ($('#nasa-login-register-form').length <= 0) {
|
||||
var _content = $('#tmpl-nasa-register-form').html();
|
||||
$('.nasa-login-register-warper').html(_content);
|
||||
$('#tmpl-nasa-register-form').remove();
|
||||
|
||||
$('body').trigger('nasa_login_register_ajax_inited');
|
||||
}
|
||||
$('body').trigger('nasa_login_register_ajax_inited');
|
||||
}
|
||||
|
||||
if ($(this).attr('data-enable') === '1' && $('#customer_login').length <= 0) {
|
||||
if ($(this).attr('data-enable') === '1' && $('#customer_login').length <= 0) {
|
||||
$('#nasa-menu-sidebar-content').removeClass('nasa-active');
|
||||
$('#mobile-navigation').attr('data-show', '0');
|
||||
|
||||
@@ -2420,6 +2421,9 @@ jQuery(document).ready(function ($) {
|
||||
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
window.location.href = $(this).attr('href');
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -2676,4 +2680,92 @@ jQuery(document).ready(function ($) {
|
||||
$(_nav).find('.nasa-nav-arrow.slick-next ').attr('class',$(_slider).find('.nasa-nav-arrow.slick-next ').attr('class'));
|
||||
|
||||
});
|
||||
|
||||
$('body').on('click','#vertical-menu-float .vertical_float_menu_title a, .nasa-vertical-menu-float-mobile-toggle, .vertical_float_menu_toggle .nasa-title-vertical-menu', function() {
|
||||
var _wrap = $('#vertical-menu-float');
|
||||
if ($(_wrap).hasClass('nasa-active')) {
|
||||
$('.black-window').fadeOut(200).removeClass('desk-window');
|
||||
|
||||
timeout_box_shadow = setTimeout(function() {
|
||||
$('.black-window').removeClass('vertical-menu-float-bg');
|
||||
$(_wrap).removeClass('nav-dropdown-delay-0');
|
||||
}, 300);
|
||||
|
||||
$(_wrap).removeClass('nasa-active');
|
||||
$('body').removeClass('m-ovhd');
|
||||
} else {
|
||||
if (typeof timeout_box_shadow !== 'undefined') {
|
||||
clearTimeout(timeout_box_shadow);
|
||||
}
|
||||
$(_wrap).addClass('nasa-active');
|
||||
$('.black-window').fadeIn(200).addClass('desk-window vertical-menu-float-bg');
|
||||
$('body').addClass('m-ovhd');
|
||||
}
|
||||
});
|
||||
|
||||
$('body').on('mouseleave', '#vertical-menu-float', function () {
|
||||
var _this = $(this);
|
||||
|
||||
if (!_mobileView && !$('body').hasClass('nasa-in-mobile') && !$('body').hasClass('nasa-mobile-app')) {
|
||||
if ($(_this).hasClass('nasa-active')) {
|
||||
$(_this).find('.vertical_float_menu_title a').trigger('click');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('body').on('mousemove', '#vertical-menu-float', function (e) {
|
||||
var _this = $(this);
|
||||
var width = $(_this).width();
|
||||
if (_mobileView || $('body').hasClass('nasa-in-mobile') || $('body').hasClass('nasa-mobile-app')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$(_this).hasClass('nasa-active')) {
|
||||
$(_this).find('.vertical_float_menu_title a').trigger('click');
|
||||
|
||||
} else if (!$(_this).hasClass('nav-dropdown-delay-0') && width >= 280) {
|
||||
$(_this).addClass('nav-dropdown-delay-0');
|
||||
}
|
||||
});
|
||||
|
||||
$('body').on('click', '#vertical-menu-float .vertical-menu-float-wrapper >li.menu-item-has-children >.nasa-title-menu',function(event) {
|
||||
if (_mobileView || $('body').hasClass('nasa-in-mobile') || $('body').hasClass('nasa-mobile-app')) {
|
||||
|
||||
event.preventDefault();
|
||||
var _this = $(this);
|
||||
var _parent = $(_this).parents('.menu-item-has-children');
|
||||
var _dropdown = $(_parent).find('>.nav-dropdown');
|
||||
var _itemactive = $('#vertical-menu-float .vertical-menu-float-wrapper >li.menu-item-has-children.nasa-active');
|
||||
|
||||
if ($(_parent).hasClass('nasa-active')) {
|
||||
$(_parent).removeClass('nasa-active');
|
||||
$(_dropdown).slideUp(300);
|
||||
} else {
|
||||
$(_parent).addClass('nasa-active');
|
||||
$(_dropdown).slideDown(300);
|
||||
$(_itemactive).removeClass('nasa-active');
|
||||
$(_itemactive).find('>.nav-dropdown').slideUp(300);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('body').on('nasa_media_all_pause',function() {
|
||||
$('video, audio').each(function() {
|
||||
if (!this.paused) {
|
||||
this.pause();
|
||||
}
|
||||
});
|
||||
|
||||
$('iframe').each(function() {
|
||||
var iframe = this;
|
||||
var src = $(iframe).attr('src');
|
||||
|
||||
if (src && src.includes('youtube.com/embed') && iframe.contentWindow) {
|
||||
iframe.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
|
||||
} else {
|
||||
$(iframe).attr('src',src);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
+14
-7
@@ -214,8 +214,7 @@ jQuery(document).ready(function ($) {
|
||||
$('body').find('.nasa-header-sticky').length &&
|
||||
$('.sticky-wrapper').length &&
|
||||
$('.nasa-header-sticky-wrap').length &&
|
||||
screen_h < content_height &&
|
||||
!$('body').hasClass('nasa-mobile-app')
|
||||
screen_h < content_height
|
||||
) {
|
||||
var fix_top = $('#wpadminbar').length ? $('#wpadminbar').height() : 0;
|
||||
var _heightFixed = $('.sticky-wrapper').outerHeight();
|
||||
@@ -223,7 +222,7 @@ jQuery(document).ready(function ($) {
|
||||
var fix_nasa_topbar_wrap = $('.nasa-topbar-wrap').length && !$('.nasa-topbar-wrap').hasClass('nasa-topbar-hide') ? $('.nasa-topbar-wrap').outerHeight() : 0;
|
||||
|
||||
if (scrollTop > lastScrollTop) {
|
||||
$('#header-content').css({top: (fix_top - ($('#header-content').outerHeight() + 50) )});
|
||||
$('#header-content').css({top: (fix_top - ($('#header-content .nasa-header-sticky').outerHeight() + 50) )});
|
||||
}
|
||||
|
||||
if (scrollTop > headerHeight) {
|
||||
@@ -727,6 +726,7 @@ jQuery(document).ready(function ($) {
|
||||
* Close by fog window
|
||||
*/
|
||||
$('body').on('click', '.black-window, .white-window, .transparent-desktop, .transparent-mobile, .transparent-window, .nasa-close-mini-compare, .nasa-sidebar-close a, .nasa-sidebar-return-shop, .login-register-close, .nasa-close-menu-mobile', function () {
|
||||
$('body').trigger('nasa_media_all_pause');
|
||||
|
||||
if ($('#nasa-age-verification-popup-wrap.nasa-active').length) {
|
||||
return;
|
||||
@@ -933,6 +933,13 @@ jQuery(document).ready(function ($) {
|
||||
$('.nasa-top-bar-3-content a.nasa-tab-filter-topbar').trigger('click');
|
||||
}
|
||||
|
||||
/**
|
||||
* Close vertical menu float
|
||||
*/
|
||||
if ($('#vertical-menu-float').length && $('#vertical-menu-float').hasClass('nasa-active')) {
|
||||
$('#vertical-menu-float .vertical_float_menu_title a').trigger('click');
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide compare product
|
||||
*/
|
||||
@@ -1265,7 +1272,7 @@ jQuery(document).ready(function ($) {
|
||||
/**
|
||||
* After Add To Cart
|
||||
*/
|
||||
$('body').on('added_to_cart', function (ev, fragments, cart_hash, _button) {
|
||||
$('body').on('added_to_cart', function (ev, fragments, cart_hash, _button) {
|
||||
/**
|
||||
* Close quick-view
|
||||
*/
|
||||
@@ -1806,10 +1813,10 @@ jQuery(document).ready(function ($) {
|
||||
|
||||
$('body').on('nasa_after_load_ajax', function (e) {
|
||||
/**
|
||||
* Refress Cart icon
|
||||
* Refress Cart icon when ajax complete - Header with different style svg cart icon
|
||||
*/
|
||||
if (typeof _nasa_cart['.cart-inner'] !== 'undefined') {
|
||||
$('.cart-inner').replaceWith(_nasa_cart['.cart-inner']);
|
||||
if (typeof _nasa_cart['.cart-inner'] !== 'undefined' && _nasa_cart['.cart-inner'].length) {
|
||||
$('.cart-inner').replaceWith(_nasa_cart['.cart-inner'].clone());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
Vendored
+2
-2
File diff suppressed because one or more lines are too long
Vendored
+3
-3
File diff suppressed because one or more lines are too long
@@ -345,7 +345,7 @@ jQuery(document).ready(function ($) {
|
||||
}
|
||||
|
||||
if ($('.product-lightbox').find('.nasa-product-gallery-lightbox .main-image-slider').length && !$('.product-lightbox').find('.nasa-product-gallery-lightbox .main-image-slider').hasClass('nasa-nav-radius')) {
|
||||
$('.product-lightbox').find('.nasa-product-gallery-lightbox .main-image-slider').addClass('nasa-nav-radius')
|
||||
$('.product-lightbox').find('.nasa-product-gallery-lightbox .main-image-slider').addClass('nasa-nav-radius');
|
||||
}
|
||||
|
||||
var groupLightBox = $('.product-lightbox').find('.woocommerce-grouped-product-list-item');
|
||||
@@ -460,7 +460,7 @@ jQuery(document).ready(function ($) {
|
||||
}
|
||||
|
||||
if ($('.product-lightbox').find('.nasa-product-gallery-lightbox .main-image-slider').length && !$('.product-lightbox').find('.nasa-product-gallery-lightbox .main-image-slider').hasClass('nasa-nav-radius')) {
|
||||
$('.product-lightbox').find('.nasa-product-gallery-lightbox .main-image-slider').addClass('nasa-nav-radius')
|
||||
$('.product-lightbox').find('.nasa-product-gallery-lightbox .main-image-slider').addClass('nasa-nav-radius');
|
||||
}
|
||||
|
||||
var groupLightBox = $('.product-lightbox').find('.woocommerce-grouped-product-list-item');
|
||||
|
||||
+18
-25
@@ -340,6 +340,8 @@ $('body').on('click', "a.product-video-popup", function(e) {
|
||||
closeOnVerticalDrag:false
|
||||
};
|
||||
|
||||
$('body').trigger('nasa_media_all_pause');
|
||||
|
||||
if (productVideo) {
|
||||
var embedUrl = nasa_ember_link(productVideo);
|
||||
items.push({
|
||||
@@ -388,11 +390,7 @@ $('body').on('nasa_after_single_product_slick_inited', function(ev, _thumbs, _nu
|
||||
var _this = $(this);
|
||||
$('body').trigger('nasa_check_slick_disabled', [_this]);
|
||||
|
||||
$('.nasa-single-product-slide .nasa-single-product-main-image video').each(function() {
|
||||
if (!this.paused) {
|
||||
this.pause();
|
||||
}
|
||||
});
|
||||
$('body').trigger('nasa_media_all_pause');
|
||||
});
|
||||
|
||||
if (_thumbs) {
|
||||
@@ -1501,19 +1499,12 @@ $('body').on('click','.main_min_img, .woocommerce-product-gallery__wrapper .main
|
||||
});
|
||||
|
||||
gallery.listen('beforeChange', function() {
|
||||
$('video').each(function() {
|
||||
if (!this.paused) {
|
||||
this.pause();
|
||||
}
|
||||
});
|
||||
$('body').trigger('nasa_media_all_pause');
|
||||
});
|
||||
|
||||
gallery.listen('close', function (index, item) {
|
||||
$('video').each(function() {
|
||||
if (!this.paused) {
|
||||
this.pause();
|
||||
}
|
||||
});
|
||||
$('body').trigger('nasa_media_all_pause');
|
||||
$(pswpElement).remove();
|
||||
});
|
||||
|
||||
gallery.init();
|
||||
@@ -1595,6 +1586,9 @@ $('body').on('click','.commentlist .nasa-wrap-review-thumb .nasa-item-review-thu
|
||||
})
|
||||
|
||||
$('body').addClass('ovhd');
|
||||
|
||||
$('body').trigger('nasa_media_all_pause');
|
||||
|
||||
$('body').trigger('nasa_reload_slick_slider_private', $('.nasa-slide-popup-review'));
|
||||
$('.nasa-slide-popup-review').addClass('nasa-active');
|
||||
|
||||
@@ -1605,10 +1599,13 @@ $('body').on('click','.commentlist .nasa-wrap-review-thumb .nasa-item-review-thu
|
||||
// }
|
||||
|
||||
$('.nasa-slide-popup-review >.nasa-slick-slider').on('beforeChange', function(event, slick, currentSlide) {
|
||||
var _videos = $('.nasa-slide-popup-review').find('.ns-video-review');
|
||||
_videos.each(function() {
|
||||
this.pause();
|
||||
});
|
||||
// var _videos = $('.nasa-slide-popup-review').find('.ns-video-review');
|
||||
// _videos.each(function() {
|
||||
// this.pause();
|
||||
// });
|
||||
|
||||
$('body').trigger('nasa_media_all_pause');
|
||||
|
||||
// if ($(_lm_btn).length) {
|
||||
// if (currentSlide >= slick.slideCount-2) {
|
||||
// nasa_get_ajax_load_review_slide($,$('.nasa-slide-popup-review >.nasa-slick-slider'))
|
||||
@@ -1621,12 +1618,8 @@ $('body').on('click','.nasa-slide-popup-review .close-review-slide-popup,.nasa-s
|
||||
e.preventDefault();
|
||||
var _this = $(this);
|
||||
var _pa = $(_this).parents('.nasa-slide-popup-review');
|
||||
var _videos = $(_pa).find('.ns-video-review');
|
||||
|
||||
_videos.each(function() {
|
||||
this.pause();
|
||||
});
|
||||
|
||||
$('body').trigger('nasa_media_all_pause');
|
||||
$('body').removeClass('ovhd');
|
||||
$(_pa).fadeOut(300);
|
||||
setTimeout(function() {
|
||||
@@ -2221,7 +2214,7 @@ function nasa_ember_link(link) {
|
||||
startTime = link.substring(startIndex + 2);
|
||||
}
|
||||
|
||||
var embedUrl = 'https://www.youtube.com/embed/' + videoId + '?autoplay=1';
|
||||
var embedUrl = 'https://www.youtube.com/embed/' + videoId + '?autoplay=1&enablejsapi=1';
|
||||
if (startTime) {
|
||||
embedUrl += '&start=' + startTime;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user