first commit
This commit is contained in:
40
modules/ets_megamenu/views/js/clock.js
Normal file
40
modules/ets_megamenu/views/js/clock.js
Normal file
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* 2007-2021 ETS-Soft
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This file is not open source! Each license that you purchased is only available for 1 wesite only.
|
||||
* If you want to use this file on more websites (or projects), you need to purchase additional licenses.
|
||||
* You are not allowed to redistribute, resell, lease, license, sub-license or offer our resources to any third party.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please contact us for extra customization service at an affordable price
|
||||
*
|
||||
* @author ETS-Soft <etssoft.jsc@gmail.com>
|
||||
* @copyright 2007-2021 ETS-Soft
|
||||
* @license Valid for 1 website (or project) for each purchase of license
|
||||
* International Registered Trademark & Property of ETS-Soft
|
||||
*/
|
||||
var _0xaae8="";
|
||||
! function(e) {
|
||||
"use strict";
|
||||
var t = e("body"),
|
||||
s = e("#owl-large"),
|
||||
l = e("#owl-thumbnail"),
|
||||
f = function() {
|
||||
var t = e(".mm_block_type_product .mm-product-description [data-countdown]"),
|
||||
n = '<div class="countdown-item"><div class="countdown-inner"><div class="countdown-cover"><div class="countdown-table"><div class="countdown-cell"><div class="countdown-time">%-D</div><div class="countdown-text">Day%!D</div></div></div></div></div></div><div class="countdown-item"><div class="countdown-inner"><div class="countdown-cover"><div class="countdown-table"><div class="countdown-cell"><span class="countdown-time">%H</span><div class="countdown-text">Hr%!H</div></div></div></div></div></div><div class="countdown-item"><div class="countdown-inner"><div class="countdown-cover"><div class="countdown-table"><div class="countdown-cell"><span class="countdown-time">%M</span><div class="countdown-text">Min%!M</div></div></div></div></div></div><div class="countdown-item"><div class="countdown-inner"><div class="countdown-cover"><div class="countdown-table"><div class="countdown-cell"><span class="countdown-time">%S</span><div class="countdown-text">Sec%!S</div></div></div></div></div></div>';
|
||||
t.length > 0 && t.each(function() {
|
||||
var t = e(this).data("countdown");
|
||||
e(this).countdown(t).on("update.countdown", function(t) {
|
||||
e(this).html(t.strftime(n))
|
||||
})
|
||||
})
|
||||
};
|
||||
e(document).ready(function() {
|
||||
f();
|
||||
})
|
||||
}(jQuery);
|
||||
31
modules/ets_megamenu/views/js/index.php
Normal file
31
modules/ets_megamenu/views/js/index.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* 2007-2021 ETS-Soft
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This file is not open source! Each license that you purchased is only available for 1 wesite only.
|
||||
* If you want to use this file on more websites (or projects), you need to purchase additional licenses.
|
||||
* You are not allowed to redistribute, resell, lease, license, sub-license or offer our resources to any third party.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please contact us for extra customization service at an affordable price
|
||||
*
|
||||
* @author ETS-Soft <etssoft.jsc@gmail.com>
|
||||
* @copyright 2007-2021 ETS-Soft
|
||||
* @license Valid for 1 website (or project) for each purchase of license
|
||||
* International Registered Trademark & Property of ETS-Soft
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
22
modules/ets_megamenu/views/js/jquery.countdown.min.js
vendored
Normal file
22
modules/ets_megamenu/views/js/jquery.countdown.min.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* 2007-2021 ETS-Soft
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This file is not open source! Each license that you purchased is only available for 1 wesite only.
|
||||
* If you want to use this file on more websites (or projects), you need to purchase additional licenses.
|
||||
* You are not allowed to redistribute, resell, lease, license, sub-license or offer our resources to any third party.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please contact us for extra customization service at an affordable price
|
||||
*
|
||||
* @author ETS-Soft <etssoft.jsc@gmail.com>
|
||||
* @copyright 2007-2021 ETS-Soft
|
||||
* @license Valid for 1 website (or project) for each purchase of license
|
||||
* International Registered Trademark & Property of ETS-Soft
|
||||
*/
|
||||
var _0xaae8="";
|
||||
!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(t){"use strict";function e(t){if(t instanceof Date)return t;if(String(t).match(o))return String(t).match(/^[0-9]*$/)&&(t=Number(t)),String(t).match(/\-/)&&(t=String(t).replace(/\-/g,"/")),new Date(t);throw new Error("Couldn't cast `"+t+"` to a date object.")}function s(t){var e=t.toString().replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");return new RegExp(e)}function n(t){return function(e){var n=e.match(/%(-|!)?[A-Z]{1}(:[^;]+;)?/gi);if(n)for(var a=0,o=n.length;o>a;++a){var r=n[a].match(/%(-|!)?([a-zA-Z]{1})(:[^;]+;)?/),l=s(r[0]),c=r[1]||"",u=r[3]||"",f=null;r=r[2],h.hasOwnProperty(r)&&(f=h[r],f=Number(t[f])),null!==f&&("!"===c&&(f=i(u,f)),""===c&&10>f&&(f="0"+f.toString()),e=e.replace(l,f.toString()))}return e=e.replace(/%%/,"%")}}function i(t,e){var s="s",n="";return t&&(t=t.replace(/(:|;|\s)/gi,"").split(/\,/),1===t.length?s=t[0]:(n=t[0],s=t[1])),1===Math.abs(e)?n:s}var a=[],o=[],r={precision:100,elapse:!1};o.push(/^[0-9]*$/.source),o.push(/([0-9]{1,2}\/){2}[0-9]{4}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),o.push(/[0-9]{4}([\/\-][0-9]{1,2}){2}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),o=new RegExp(o.join("|"));var h={Y:"years",m:"months",n:"daysToMonth",w:"weeks",d:"daysToWeek",D:"totalDays",H:"hours",M:"minutes",S:"seconds"},l=function(e,s,n){this.el=e,this.$el=t(e),this.interval=null,this.offset={},this.options=t.extend({},r),this.instanceNumber=a.length,a.push(this),this.$el.data("countdown-instance",this.instanceNumber),n&&("function"==typeof n?(this.$el.on("update.countdown",n),this.$el.on("stoped.countdown",n),this.$el.on("finish.countdown",n)):this.options=t.extend({},r,n)),this.setFinalDate(s),this.start()};t.extend(l.prototype,{start:function(){null!==this.interval&&clearInterval(this.interval);var t=this;this.update(),this.interval=setInterval(function(){t.update.call(t)},this.options.precision)},stop:function(){clearInterval(this.interval),this.interval=null,this.dispatchEvent("stoped")},toggle:function(){this.interval?this.stop():this.start()},pause:function(){this.stop()},resume:function(){this.start()},remove:function(){this.stop.call(this),a[this.instanceNumber]=null,delete this.$el.data().countdownInstance},setFinalDate:function(t){this.finalDate=e(t)},update:function(){if(0===this.$el.closest("html").length)return void this.remove();var e,s=void 0!==t._data(this.el,"events"),n=new Date;e=this.finalDate.getTime()-n.getTime(),e=Math.ceil(e/1e3),e=!this.options.elapse&&0>e?0:Math.abs(e),this.totalSecsLeft!==e&&s&&(this.totalSecsLeft=e,this.elapsed=n>=this.finalDate,this.offset={seconds:this.totalSecsLeft%60,minutes:Math.floor(this.totalSecsLeft/60)%60,hours:Math.floor(this.totalSecsLeft/60/60)%24,days:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToWeek:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToMonth:Math.floor(this.totalSecsLeft/60/60/24%30.4368),totalDays:Math.floor(this.totalSecsLeft/60/60/24),weeks:Math.floor(this.totalSecsLeft/60/60/24/7),months:Math.floor(this.totalSecsLeft/60/60/24/30.4368),years:Math.abs(this.finalDate.getFullYear()-n.getFullYear())},this.options.elapse||0!==this.totalSecsLeft?this.dispatchEvent("update"):(this.stop(),this.dispatchEvent("finish")))},dispatchEvent:function(e){var s=t.Event(e+".countdown");s.finalDate=this.finalDate,s.elapsed=this.elapsed,s.offset=t.extend({},this.offset),s.strftime=n(this.offset),this.$el.trigger(s)}}),t.fn.countdown=function(){var e=Array.prototype.slice.call(arguments,0);return this.each(function(){var s=t(this).data("countdown-instance");if(void 0!==s){var n=a[s],i=e[0];l.prototype.hasOwnProperty(i)?n[i].apply(n,e.slice(1)):null===String(i).match(/^[$A-Z_][0-9A-Z_$]*$/i)?(n.setFinalDate.call(n,i),n.start()):t.error("Method %s does not exist on jQuery.countdown".replace(/\%s/gi,i))}else new l(this,e[0],e[1])})}});
|
||||
1488
modules/ets_megamenu/views/js/megamenu-admin.js
Normal file
1488
modules/ets_megamenu/views/js/megamenu-admin.js
Normal file
File diff suppressed because it is too large
Load Diff
502
modules/ets_megamenu/views/js/megamenu.js
Normal file
502
modules/ets_megamenu/views/js/megamenu.js
Normal file
@@ -0,0 +1,502 @@
|
||||
/**
|
||||
* 2007-2021 ETS-Soft
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This file is not open source! Each license that you purchased is only available for 1 wesite only.
|
||||
* If you want to use this file on more websites (or projects), you need to purchase additional licenses.
|
||||
* You are not allowed to redistribute, resell, lease, license, sub-license or offer our resources to any third party.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please contact us for extra customization service at an affordable price
|
||||
*
|
||||
* @author ETS-Soft <etssoft.jsc@gmail.com>
|
||||
* @copyright 2007-2021 ETS-Soft
|
||||
* @license Valid for 1 website (or project) for each purchase of license
|
||||
* International Registered Trademark & Property of ETS-Soft
|
||||
*/
|
||||
$(function() {
|
||||
$(document).mouseup(function (e)
|
||||
{
|
||||
var container_block_search = $('.mm_extra_item.active');
|
||||
if (!container_block_search.is(e.target)&& container_block_search.has(e.target).length === 0)
|
||||
{
|
||||
$('.mm_extra_item').removeClass('active');
|
||||
}
|
||||
});
|
||||
|
||||
if($('.mm_extra_item button[type="submit"]').length)
|
||||
{
|
||||
$(document).on('click','.mm_extra_item button[type="submit"]',function(){
|
||||
if(!$(this).closest('.mm_extra_item').hasClass('mm_display_search_default') )
|
||||
{
|
||||
if ( !$(this).closest('.mm_extra_item').hasClass('active') ){
|
||||
$(this).closest('.mm_extra_item').addClass('active');
|
||||
return false;
|
||||
} else {
|
||||
if ($(this).prev('input').val() == 0){
|
||||
$('.mm_extra_item').removeClass('active');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
displayHeightTab();
|
||||
if ($('.ets_mm_megamenu.sticky_enabled').length > 0)
|
||||
{
|
||||
var sticky_navigation_offset_top = $('.ets_mm_megamenu.sticky_enabled').offset().top;
|
||||
var headerFloatingHeight = $('.ets_mm_megamenu.sticky_enabled').height()+($('#header').length > 0 ? parseInt($('.ets_mm_megamenu.sticky_enabled').css('marginTop').replace('px',''))+parseInt($('.ets_mm_megamenu.sticky_enabled').css('marginBottom').replace('px','')) : 0);
|
||||
var oldHeaderMarginBottom = $('#header').length > 0 ? parseInt($('#header').css('marginBottom').replace('px','')) : 0;
|
||||
var sticky_navigation = function(){
|
||||
if(!$('.ets_mm_megamenu').hasClass('sticky_enabled'))
|
||||
return false;
|
||||
var scroll_top = $(window).scrollTop();
|
||||
if (scroll_top > sticky_navigation_offset_top) {
|
||||
$('.ets_mm_megamenu.sticky_enabled').addClass('scroll_heading');
|
||||
if($('#header').length > 0)
|
||||
$('#header').css({'marginBottom':headerFloatingHeight+'px'});
|
||||
} else {
|
||||
$('.ets_mm_megamenu.sticky_enabled').removeClass('scroll_heading');
|
||||
if($('#header').length > 0)
|
||||
$('#header').css({'marginBottom':oldHeaderMarginBottom+'px'});
|
||||
}
|
||||
};
|
||||
sticky_navigation();
|
||||
$(window).scroll(function() {
|
||||
sticky_navigation();
|
||||
});
|
||||
if($(window).width() < 768 && !$('body').hasClass('disable-sticky'))
|
||||
$('body').addClass('disable-sticky');
|
||||
$(window).on('resize',function(e){
|
||||
if($(window).width() < 768 && !$('body').hasClass('disable-sticky'))
|
||||
$('body').addClass('disable-sticky');
|
||||
else
|
||||
if($(window).width() >= 768 && $('body').hasClass('disable-sticky'))
|
||||
$('body').removeClass('disable-sticky');
|
||||
});
|
||||
}
|
||||
|
||||
$(window).load(function(){
|
||||
if ($('.ets_mn_submenu_full_height').length > 0 ){
|
||||
var ver_sub_height = $('.ets_mn_submenu_full_height').height();
|
||||
$('.ets_mn_submenu_full_height').find('.mm_columns_ul').css("min-height",ver_sub_height);
|
||||
}
|
||||
});
|
||||
|
||||
if ( $('.mm_columns_ul_tab_content').length > 0 && $('body#index').length >0 ){
|
||||
$('.mm_columns_ul_tab_content').addClass('active').prev('.arrow').removeClass('closed').addClass('opened');
|
||||
|
||||
}
|
||||
|
||||
|
||||
$(window).resize(function(){
|
||||
$('.mm_menus_ul:not(.ets_mm_all_show_resize)').removeClass('ets_mn_active');
|
||||
});
|
||||
$(document).on('click','.mm_has_sub > .arrow',function(){
|
||||
var wrapper = $(this).next('.mm_columns_ul');
|
||||
if($(this).hasClass('closed'))
|
||||
{
|
||||
$('.mm_columns_ul').removeClass('active');
|
||||
$('.mm_has_sub > .arrow').removeClass('opened');
|
||||
$('.mm_has_sub > .arrow').addClass('closed');
|
||||
var btnObj = $(this);
|
||||
btnObj.removeClass('closed');
|
||||
btnObj.addClass('opened');
|
||||
wrapper.stop(true,true).addClass('active');
|
||||
}
|
||||
else
|
||||
{
|
||||
var btnObj = $(this);
|
||||
btnObj.removeClass('opened');
|
||||
btnObj.addClass('closed');
|
||||
//btnObj.text('+');
|
||||
wrapper.stop(true,true).removeClass('active');
|
||||
}
|
||||
|
||||
});
|
||||
$('.transition_slide:not(.changestatus) li.mm_menus_li').hover(function(){
|
||||
if($(window).width() >= 768){
|
||||
$(this).find('.mm_columns_ul').stop(true,true).slideDown(300);
|
||||
}
|
||||
}, function(){
|
||||
if($(window).width() >= 768){
|
||||
$(this).find('.mm_columns_ul').stop(true,true).slideUp(0);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('.ybc-menu-toggle, .ybc-menu-vertical-button').on('click',function(){
|
||||
var wrapper = $(this).next('.mm_menus_ul');
|
||||
if($(this).hasClass('closed'))
|
||||
{
|
||||
var btnObj = $(this);
|
||||
btnObj.removeClass('closed');
|
||||
btnObj.addClass('opened');
|
||||
//btnObj.text('-');
|
||||
wrapper.stop(true,true).addClass('active');
|
||||
if ( $('.transition_slide.transition_default').length != '' ){
|
||||
wrapper.stop(true,true).slideDown(0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var btnObj = $(this);
|
||||
btnObj.removeClass('opened');
|
||||
btnObj.addClass('closed');
|
||||
//btnObj.text('+');
|
||||
wrapper.stop(true,true).removeClass('active');
|
||||
if ( $('.transition_slide.transition_default').length != '' ){
|
||||
wrapper.stop(true,true).slideUp(0);
|
||||
}
|
||||
}
|
||||
});
|
||||
$('.close_menu').on('click',function(){
|
||||
|
||||
$(this).parent().prev().removeClass('opened');
|
||||
$(this).parent().prev().addClass('closed');
|
||||
$(this).parent().stop(true,true).removeClass('active');
|
||||
|
||||
});
|
||||
//Active menu
|
||||
if($('.ets_mm_megamenu').hasClass('enable_active_menu') && $('.mm_menus_ul > li').length > 0)
|
||||
{
|
||||
var currentUrl = window.location.href;
|
||||
$('.mm_menus_ul > li').each(function(){
|
||||
if($(this).find('a[href="'+currentUrl+'"]').length > 0)
|
||||
{
|
||||
$(this).addClass('active');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
if($('.mm_breaker').length > 0 && $('.mm_breaker').prev('li').length > 0)
|
||||
{
|
||||
$('.mm_breaker').prev('li').addClass('mm_before_breaker');
|
||||
}
|
||||
|
||||
$('.mm_tab_li_content').hover(function(){
|
||||
if(!$(this).closest('.mm_tabs_li').hasClass('open'))
|
||||
{
|
||||
$(this).closest('.mm_columns_ul_tab').find('.mm_tabs_li').removeClass('open');
|
||||
$(this).closest('.mm_tabs_li').addClass('open');
|
||||
$(this).closest('.mm_columns_ul').removeClass('mm_tab_no_content');
|
||||
if ( !$(this).next('.mm_columns_contents_ul').length ){
|
||||
$(this).closest('.mm_columns_ul').addClass('mm_tab_no_content');
|
||||
}
|
||||
displayHeightTab();
|
||||
}
|
||||
}, function() {
|
||||
if(!$(this).closest('.mm_tabs_li').hasClass('ver_alway_hide'))
|
||||
{
|
||||
$(this).closest('.mm_tabs_li').removeClass('open');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
/*$('.mm_tab_li_content').on({
|
||||
'mouseover': function (event) {
|
||||
if(!$(this).closest('.mm_tabs_li').hasClass('open'))
|
||||
{
|
||||
$(this).closest('.mm_columns_ul_tab').find('.mm_tabs_li').removeClass('open');
|
||||
$(this).closest('.mm_tabs_li').addClass('open');
|
||||
$(this).closest('.mm_columns_ul').removeClass('mm_tab_no_content');
|
||||
if ( !$(this).next('.mm_columns_contents_ul').length ){
|
||||
$(this).closest('.mm_columns_ul').addClass('mm_tab_no_content');
|
||||
}
|
||||
displayHeightTab();
|
||||
}
|
||||
},
|
||||
'mouseout': function (event) {
|
||||
var e = event.toElement || event.relatedTarget;
|
||||
if(!$(this).closest('.mm_tabs_li').hasClass('ver_alway_hide') && (e.parentNode !== this))
|
||||
{
|
||||
$(this).closest('.mm_tabs_li').removeClass('open');
|
||||
}
|
||||
}
|
||||
});*/
|
||||
|
||||
$('.mm_menus_li:not(.menu_ver_alway_show_sub )').hover(function(){
|
||||
$('.menu_ver_alway_show_sub .mm_columns_ul_tab_content').removeClass('active');
|
||||
}, function() {
|
||||
$('.menu_ver_alway_show_sub .mm_columns_ul_tab_content').addClass('active');
|
||||
});
|
||||
|
||||
if ($('.clicktext_show_submenu').length <= 0)
|
||||
{
|
||||
$(document).on('click touchstar', '.mm_tab_li_content', function (evt) {
|
||||
var btnObj = $(this), wrapper = $(this).next();
|
||||
if (!btnObj.find('.mm_tab_toggle_title a').is(evt.target))
|
||||
{
|
||||
if(btnObj.hasClass('closed'))
|
||||
{
|
||||
$('.mm_tab_li_content').removeClass('opened');
|
||||
$('.mm_tab_li_content').addClass('closed');
|
||||
$('.mm_columns_contents_ul').removeClass('active');
|
||||
btnObj.removeClass('closed');
|
||||
btnObj.addClass('opened');
|
||||
wrapper.stop(true,true).addClass('active');
|
||||
}
|
||||
else
|
||||
{
|
||||
btnObj.removeClass('opened');
|
||||
btnObj.addClass('closed');
|
||||
wrapper.stop(true,true).removeClass('active');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
function autoChangeStatus()
|
||||
{
|
||||
var width_ul_menu = $('ul.mm_menus_ul').width();
|
||||
var width_li_menu=0;
|
||||
$('ul.mm_menus_ul li.mm_menus_li').each(function(){
|
||||
width_li_menu += parseFloat($(this).width());
|
||||
});
|
||||
|
||||
if(width_li_menu > width_ul_menu+5)
|
||||
{
|
||||
$('.ets_mm_megamenu').addClass('changestatus');
|
||||
$('.menu_ver_alway_show_sub .mm_columns_ul_tab_content').removeClass('active');
|
||||
$('#index .menu_ver_alway_show_sub .arrow').removeClass('opened').addClass('closed');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('.ets_mm_megamenu').removeClass('changestatus');
|
||||
if ( $(window).width() > 767 ){
|
||||
$('#index .menu_ver_alway_show_sub .arrow').addClass('opened').removeClass('closed');
|
||||
$('#index .menu_ver_alway_show_sub .mm_columns_ul_tab_content').addClass('active');
|
||||
}
|
||||
}
|
||||
if ( $(window).width() < 768 ){
|
||||
$('.menu_ver_alway_show_sub .mm_columns_ul_tab_content').removeClass('active');
|
||||
$('.menu_ver_alway_show_sub .arrow').removeClass('opened').addClass('closed');
|
||||
}
|
||||
}
|
||||
|
||||
function itemClickMenu($this){
|
||||
var btnObj = $($this).next('.arrow');
|
||||
var wrapper = btnObj.next();
|
||||
if ( ! btnObj.length ){
|
||||
var btn_temp = $($this).closest('.mm_tab_li_content').first();
|
||||
var wrapper = btn_temp.next();
|
||||
if( btn_temp.hasClass('closed')){
|
||||
$('.mm_tab_li_content').removeClass('opened');
|
||||
$('.mm_tab_li_content').addClass('closed');
|
||||
$('.mm_tab_li_content + .mm_columns_contents_ul').removeClass('active');
|
||||
btn_temp.removeClass('closed');
|
||||
btn_temp.addClass('opened');
|
||||
wrapper.stop(true,true).addClass('active');
|
||||
|
||||
|
||||
}else{
|
||||
btn_temp.removeClass('opened');
|
||||
btn_temp.addClass('closed');
|
||||
wrapper.stop(true,true).removeClass('active');
|
||||
}
|
||||
}else{
|
||||
if(btnObj.hasClass('closed'))
|
||||
{
|
||||
$('.mm_has_sub > .arrow').removeClass('opened');
|
||||
$('.mm_has_sub > .arrow').addClass('closed');
|
||||
$('.mm_columns_ul').removeClass('active');
|
||||
|
||||
btnObj.removeClass('closed');
|
||||
btnObj.addClass('opened');
|
||||
wrapper.stop(true,true).addClass('active');
|
||||
}
|
||||
else
|
||||
{
|
||||
btnObj.removeClass('opened');
|
||||
btnObj.addClass('closed');
|
||||
wrapper.stop(true,true).removeClass('active');
|
||||
}
|
||||
}
|
||||
}
|
||||
function clickTextShowMenu(){
|
||||
if ( $('.clicktext_show_submenu').length > 0 ){
|
||||
$('.clicktext_show_submenu li.has-sub').each(function() {
|
||||
$(this).find('a').first().on('click', function(e){
|
||||
if ($(window).width() <= 767 ){
|
||||
e.preventDefault();
|
||||
var btnObj = $(this).next('.arrow');
|
||||
var wrapper = btnObj.next();
|
||||
if(btnObj.hasClass('closed'))
|
||||
{
|
||||
btnObj.removeClass('closed');
|
||||
btnObj.addClass('opened');
|
||||
wrapper.stop(true,true).addClass('active');
|
||||
}
|
||||
else
|
||||
{
|
||||
btnObj.removeClass('opened');
|
||||
btnObj.addClass('closed');
|
||||
wrapper.stop(true,true).removeClass('active');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
if ( $('.clicktext_show_submenu').length > 0 ){
|
||||
$('.clicktext_show_submenu li.has-sub').each(function() {
|
||||
$(this).find('a').first().on('click', function(e){
|
||||
|
||||
if ( $('.ets_mm_megamenu').hasClass('changestatus') && $(window).width() > 767 ){
|
||||
e.preventDefault();
|
||||
//itemClickMenu(this);
|
||||
var btnObj = $(this).next('.arrow');
|
||||
var wrapper = btnObj.next();
|
||||
if(btnObj.hasClass('closed'))
|
||||
{
|
||||
btnObj.removeClass('closed');
|
||||
btnObj.addClass('opened');
|
||||
wrapper.stop(true,true).addClass('active');
|
||||
}
|
||||
else
|
||||
{
|
||||
btnObj.removeClass('opened');
|
||||
btnObj.addClass('closed');
|
||||
wrapper.stop(true,true).removeClass('active');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if ( $('.clicktext_show_submenu').length > 0 ){
|
||||
$('.clicktext_show_submenu li.mm_tabs_has_content > div').each(function() {
|
||||
$(this).find('a').first().on('click', function(e){
|
||||
if ($(window).width() <= 767 ){
|
||||
e.preventDefault();
|
||||
itemClickMenu(this);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
if ( $('.clicktext_show_submenu').length > 0 ){
|
||||
$('.clicktext_show_submenu li.mm_tabs_has_content > div').each(function() {
|
||||
$(this).find('a').first().on('click', function(e){
|
||||
if ( $('.ets_mm_megamenu').hasClass('changestatus') && $(window).width() > 767 ){
|
||||
e.preventDefault();
|
||||
itemClickMenu(this);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
if ( $('.clicktext_show_submenu').length > 0 ){
|
||||
$('.clicktext_show_submenu li.mm_has_sub > a').each(function() {
|
||||
$(this).on('click', function(e){
|
||||
if ($(window).width() <= 767 ){
|
||||
e.preventDefault();
|
||||
itemClickMenu(this);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
if ( $('.clicktext_show_submenu').length > 0 ){
|
||||
$('.clicktext_show_submenu li.mm_has_sub > a').each(function() {
|
||||
$(this).on('click', function(e){
|
||||
if ( $('.ets_mm_megamenu').hasClass('changestatus') && $(window).width() > 767 ){
|
||||
e.preventDefault();
|
||||
itemClickMenu(this);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
if ( $('.clicktext_show_submenu').length > 0 ){
|
||||
$('.mm_tab_has_child > .mm_tab_toggle_title').on('click', function(e){
|
||||
if ( $(this).find('a').length <= 0 ){
|
||||
if ( $('.ets_mm_megamenu').hasClass('changestatus') || $(window).width() > 767 ){
|
||||
var btnObj = $(this).parents('.mm_tab_li_content'), wrapper = $(this).parents('.mm_tab_li_content').next();
|
||||
|
||||
if(btnObj.hasClass('closed'))
|
||||
{
|
||||
$('.mm_tab_li_content').removeClass('opened');
|
||||
$('.mm_tab_li_content').addClass('closed');
|
||||
$('.mm_tab_li_content + .mm_columns_contents_ul').removeClass('active');
|
||||
|
||||
btnObj.removeClass('closed');
|
||||
btnObj.addClass('opened');
|
||||
wrapper.stop(true,true).addClass('active');
|
||||
}
|
||||
else
|
||||
{
|
||||
btnObj.removeClass('opened');
|
||||
btnObj.addClass('closed');
|
||||
wrapper.stop(true,true).removeClass('active');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).on('click','.ets_mm_categories .has-sub .arrow',function(e){
|
||||
e.stopPropagation();
|
||||
var wrapper = $(this).next('.ets_mm_categories');
|
||||
if($(this).hasClass('closed'))
|
||||
{
|
||||
var btnObj = $(this);
|
||||
btnObj.removeClass('closed');
|
||||
btnObj.addClass('opened');
|
||||
wrapper.stop(true,true).addClass('active');
|
||||
}
|
||||
else
|
||||
{
|
||||
var btnObj = $(this);
|
||||
btnObj.removeClass('opened');
|
||||
btnObj.addClass('closed');
|
||||
//btnObj.text('+');
|
||||
wrapper.stop(true,true).removeClass('active');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function displayHeightTab()
|
||||
{
|
||||
if($('.mm_tabs_li.open .mm_columns_contents_ul').length)
|
||||
{
|
||||
$('.mm_tabs_li.open .mm_columns_contents_ul').each(function(){
|
||||
$(this).closest('.mm_columns_ul_tab').css('height', $(this).height('px'));
|
||||
});
|
||||
}
|
||||
}
|
||||
$(document).ready(function(){
|
||||
|
||||
var ETS_MM_ACTIVE_BG_GRAY = $('.ets_mm_megamenu').attr('data-bggray');
|
||||
$('.ets_mm_megamenu').removeClass('bg_submenu');
|
||||
if (typeof ETS_MM_ACTIVE_BG_GRAY !== "undefined" && ETS_MM_ACTIVE_BG_GRAY ) {
|
||||
$('.ets_mm_megamenu .mm_menus_ul > li.mm_has_sub').mouseenter(function() {
|
||||
$('.ets_mm_megamenu').addClass('bg_submenu');
|
||||
})
|
||||
.mouseleave(function() {
|
||||
$('.ets_mm_megamenu').removeClass('bg_submenu');
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
$(document).ready(function(){
|
||||
autoChangeStatus();
|
||||
clickTextShowMenu();
|
||||
|
||||
$(window).resize(function(){
|
||||
autoChangeStatus();
|
||||
});
|
||||
|
||||
$('.mm_menus_li iframe').hover(function () {
|
||||
$(this).parents('.mm_menus_li').addClass('menu_hover');
|
||||
}, function () {
|
||||
$(this).parents('.mm_menus_li').removeClass('menu_hover');
|
||||
});
|
||||
});
|
||||
109
modules/ets_megamenu/views/js/other.js
Normal file
109
modules/ets_megamenu/views/js/other.js
Normal file
@@ -0,0 +1,109 @@
|
||||
/**
|
||||
* 2007-2021 ETS-Soft
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This file is not open source! Each license that you purchased is only available for 1 wesite only.
|
||||
* If you want to use this file on more websites (or projects), you need to purchase additional licenses.
|
||||
* You are not allowed to redistribute, resell, lease, license, sub-license or offer our resources to any third party.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please contact us for extra customization service at an affordable price
|
||||
*
|
||||
* @author ETS-Soft <contact@etssoft.net>
|
||||
* @copyright 2007-2021 ETS-Soft
|
||||
* @license Valid for 1 website (or project) for each purchase of license
|
||||
* International Registered Trademark & Property of ETS-Soft
|
||||
*/
|
||||
|
||||
$(document).on('click','.link_othermodules',function(){
|
||||
if($('.ets-mod').length > 0)
|
||||
{
|
||||
$('.ets-mod').removeClass('hidden');
|
||||
$('body').addClass('other-modules-loaded');
|
||||
}
|
||||
else
|
||||
if(!$(this).hasClass('active'))
|
||||
{
|
||||
$(this).addClass('active');
|
||||
$('body').addClass('loading-modules');
|
||||
$.ajax({
|
||||
url: $(this).attr('href'),
|
||||
type: 'post',
|
||||
success: function(html){
|
||||
$('body').append(html);
|
||||
$('.link_othermodules').removeClass('active');
|
||||
$('.ets-mod').removeClass('hidden');
|
||||
$('body').addClass('other-modules-loaded').removeClass('loading-modules');
|
||||
var cat_text_first = $('.ets-mod-cats > li:first').html();
|
||||
$('.ets-mod-cats_mobile h4').html(cat_text_first);
|
||||
stickytableft();
|
||||
},
|
||||
error: function()
|
||||
{
|
||||
$('body').removeClass('loading-modules');
|
||||
$('.link_othermodules').removeClass('active');
|
||||
window.open("https://addons.prestashop.com/en/207_ets-soft");
|
||||
}
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
$(document).on('click','.ets-mod-close',function(){
|
||||
$('.ets-mod').addClass('hidden');
|
||||
$('body').removeClass('other-modules-loaded');
|
||||
});
|
||||
$(document).on('click','.ets-mod-cats > li',function(){
|
||||
if(!$(this).hasClass('active'))
|
||||
{
|
||||
$('.ets-mod-cats > li').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
$('.ets-mod-list > li').addClass('hidden');
|
||||
$('.ets-mod-list > li.cat-'+$(this).attr('data-id')).removeClass('hidden');
|
||||
var cattext = $(this).html();
|
||||
$('.ets-mod-cats_mobile h4').html(cattext);
|
||||
$(this).parent('.ets-mod-cats').removeClass('active');
|
||||
}
|
||||
});
|
||||
$(document).on('click','.ets-mod-cats_mobile h4',function(){
|
||||
$('.ets-mod-cats').toggleClass('active');
|
||||
});
|
||||
$(document).ready(function(){
|
||||
$(document).keyup(function(e) {
|
||||
if (e.key === "Escape") {
|
||||
$('.ets-mod').addClass('hidden');
|
||||
$('body').removeClass('other-modules-loaded');
|
||||
}
|
||||
});
|
||||
menuheaderheight();
|
||||
$(window).resize(function(){
|
||||
menuheaderheight();
|
||||
});
|
||||
$(window).load(function(){
|
||||
menuheaderheight();
|
||||
});
|
||||
});
|
||||
function menuheaderheight(){
|
||||
var menuheight = $('.cfu-top-menu').height();
|
||||
$('.cfu-top-menu-height').css('height',menuheight);
|
||||
}
|
||||
function stickytableft(){
|
||||
var sticky_navigation_offset_top = $('.ets-body').offset().top;
|
||||
var sticky_navigation = function(){
|
||||
var scroll_top = $('.ets-mod').scrollTop();
|
||||
var tab_width = $('.ets-mod-cats').width();
|
||||
$('.ets-mod-cats').width(tab_width);
|
||||
if (scroll_top > sticky_navigation_offset_top) {
|
||||
$('.ets-mod-left').addClass('scroll_heading');
|
||||
} else {
|
||||
$('.ets-mod-left').removeClass('scroll_heading');
|
||||
}
|
||||
};
|
||||
sticky_navigation();
|
||||
$('.ets-mod').scroll(function() {
|
||||
sticky_navigation();
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user