1/* 2 * @Website: apollotheme.com - prestashop template provider 3 * @author Apollotheme <[email protected]> 4 * @copyright Apollotheme 5 * @description: ApPageBuilder is module help you can build content for your shop 6 */ 7/* 8 * Custom code goes here. 9 * A template should always ship with an empty custom.js 10 */ 11//DONGND:: create option for slick slider of modal popup at product page 12var options_modal_product_page = { 13 speed: 300, 14 dots: false, 15 infinite: false, 16 slidesToShow: 4, 17 slidesToScroll: 1, 18 vertical: true, 19 verticalSwiping: true, 20 responsive: [ 21 { 22 breakpoint: 1200, 23 settings: { 24 slidesToShow: 3, 25 slidesToScroll: 1, 26 } 27 }, 28 { 29 breakpoint: 992, 30 settings: { 31 slidesToShow: 2, 32 slidesToScroll: 1 33 } 34 }, 35 { 36 breakpoint: 768, 37 settings: { 38 slidesToShow: 2, 39 slidesToScroll: 1 40 } 41 }, 42 { 43 breakpoint: 576, 44 settings: { 45 slidesToShow: 1, 46 slidesToScroll: 1 47 } 48 }, 49 { 50 breakpoint: 480, 51 settings: { 52 slidesToShow: 2, 53 slidesToScroll: 1 54 } 55 }, 56 { 57 breakpoint: 400, 58 settings: { 59 slidesToShow: 1, 60 slidesToScroll: 1 61 } 62 } 63 ] 64}; 65 66//DONGND:: create option for slick slider of quickview 67var options_quickview = { 68 speed: 300, 69 dots: false, 70 infinite: false, 71 slidesToShow: 4, 72 slidesToScroll: 1, 73 vertical: true, 74 verticalSwiping: true, 75 responsive: [ 76 { 77 breakpoint: 1200, 78 settings: { 79 slidesToShow: 4, 80 slidesToScroll: 1, 81 } 82 }, 83 { 84 breakpoint: 992, 85 settings: { 86 slidesToShow: 3, 87 slidesToScroll: 1 88 } 89 }, 90 { 91 breakpoint: 768, 92 settings: { 93 slidesToShow: 4, 94 slidesToScroll: 1 95 } 96 }, 97 { 98 breakpoint: 576, 99 settings: { 100 slidesToShow: 3, 101 slidesToScroll: 1 102 } 103 }, 104 { 105 breakpoint: 480, 106 settings: { 107 slidesToShow: 2, 108 slidesToScroll: 1 109 } 110 } 111 ] 112}; 113 114$( window ).resize(function() { 115 //DONGND:: fix zoom, only work at product page 116 if (prestashop.page.page_name == 'product') 117 restartElevateZoom(); 118 119 //DONGND:: fix lost slider of modal when resize 120 if ($('#product-modal .product-images').hasClass('slick-initialized') && $('#product-modal .product-images').height() == 0) 121 { 122 //DONGND:: setup slide for product thumb (modal) 123 $('#product-modal .product-images').slick('unslick'); 124 $('#product-modal .product-images').hide(); 125 initSlickProductModal(); 126 } 127}); 128 129$(document).ready(function(){ 130 floatHeader(); 131 backtotop() 132 //check page product only 133 if(prestashop.page.page_name == 'product'){ 134 innitSlickandZoom(); 135 } 136 if (prestashop.page.page_name == 'category'){ 137 setDefaultListGrid(); 138 } 139 140 if(typeof (products_list_functions) != 'undefined') 141 { 142 for (var i = 0; i < products_list_functions.length; i++) { 143 products_list_functions[i](); 144 } 145 } 146 147 //DONGND:: update for order page - tab adress, when change adress, block adress change class selected 148 $('.address-item .radio-block').click(function(){ 149 if (!$(this).parents('.address-item').hasClass('selected')) 150 { 151 $('.address-item.selected').removeClass('selected'); 152 $(this).parents('.address-item').addClass('selected'); 153 } 154 }) 155 156 //DONGND:: loading quickview 157 actionQuickViewLoading(); 158 159 prestashop.on('updateProductList', function() { 160 actionQuickViewLoading(); 161 }); 162 163 prestashop.on('updatedProduct', function () { 164 165 if ($('.quickview.modal .product-thumb-images').length) 166 { 167 //DONGND:: run slick slider for product thumb - quickview 168 initSlickProductQuickView(); 169 } 170 else if ($('.product-detail .product-thumb-images').length) 171 { 172 //DONGND:: re-call setup slick when change attribute at product page 173 innitSlickandZoom(); 174 } 175 }); 176 177 //DONGND:: display modal by config 178 if (typeof $("#content").data('templatemodal') != 'undefined') 179 { 180 if (!$("#content").data('templatemodal')) 181 { 182 $('div[data-target="#product-modal"]').hide(); 183 } 184 } 185}); 186 187function innitSlickandZoom(){ 188 if($("#main").hasClass('product-image-thumbs')){ 189 190 //DONGND:: setup slide for product thumb (main) 191 $('.product-detail .product-thumb-images').imagesLoaded( function(){ 192 193 if (typeof check_loaded_main_product != 'undefined') 194 { 195 clearInterval(check_loaded_main_product); 196 } 197 198 check_loaded_main_product = setInterval(function(){ 199 if($('.product-detail .product-thumb-images').height() > 0) 200 { 201 202 $('.product-detail .product-thumb-images').fadeIn(); 203 204 clearInterval(check_loaded_main_product); 205 postion = $("#content").data("templateview"); 206 //DONGND:: add config for over 1200 extra large 207 numberimage = $("#content").data("numberimage"); 208 numberimage1200 = $("#content").data("numberimage1200"); 209 numberimage992 = $("#content").data("numberimage992"); 210 numberimage768 = $("#content").data("numberimage768"); 211 numberimage576 = $("#content").data("numberimage576"); 212 numberimage480 = $("#content").data("numberimage480"); 213 numberimage360 = $("#content").data("numberimage360"); 214 215 if(postion !== 'undefined'){ 216 initSlickProductThumb(postion, numberimage, numberimage1200, numberimage992, numberimage768, numberimage576, numberimage480, numberimage360); 217 } 218 219 } 220 }, 300); 221 }); 222 223 //DONGND:: setup slide for product thumb (modal) 224 initSlickProductModal(); 225 226 } 227 //call action zoom 228 applyElevateZoom(); 229} 230 231function restartElevateZoom(){ 232 $(".zoomContainer").remove(); 233 applyElevateZoom(); 234} 235 236function applyElevateZoom(){ 237 if($(window).width() <= 991 || $("#content").data("templatezoomtype") == 'none') 238 { 239 //DONGND:: remove elevateZoom on mobile 240 if($('#main').hasClass('product-image-gallery')) 241 { 242 if ($('img.js-thumb').data('elevateZoom')) 243 { 244 var ezApi = $('img.js-thumb').data('elevateZoom'); 245 ezApi.changeState('disable'); 246 $('img.js-thumb').unbind("touchmove"); 247 } 248 } 249 else 250 { 251 if ($("#zoom_product").data('elevateZoom')) 252 { 253 var ezApi = $("#zoom_product").data('elevateZoom'); 254 ezApi.changeState('disable'); 255 $("#zoom_product").unbind("touchmove"); 256 } 257 } 258 return false;
259 } 260 261 //check if that is gallery, zoom all thumb 262 //DONGND:: fix zoom, create config 263 var zt = $("#content").data('templatezoomtype'); 264 var zoom_cursor; 265 var zoom_type; 266 var scroll_zoom = false; 267 var lens_FadeIn = 200; 268 var lens_FadeOut = 200; 269 var zoomWindow_FadeIn = 200; 270 var zoomWindow_FadeOut = 200; 271 var zoom_tint = false; 272 var zoomWindow_Width = 400; 273 var zoomWindow_Height = 400; 274 var zoomWindow_Position = 1; 275 276 if (zt == 'in') 277 { 278 zoom_cursor = 'crosshair'; 279 zoom_type = 'inner'; 280 lens_FadeIn = false; 281 lens_FadeOut = false; 282 } 283 else 284 { 285 zoom_cursor = 'default'; 286 zoom_type = 'window'; 287 zoom_tint = true; 288 zoomWindow_Width = $("#content").data('zoomwindowwidth'); 289 zoomWindow_Height = $("#content").data('zoomwindowheight'); 290 291 if ($("#content").data('zoomposition') == 'right') 292 { 293 //DONGND:: update position of zoom window with ar language 294 if (prestashop.language.is_rtl == 1) 295 { 296 zoomWindow_Position = 11; 297 } 298 else 299 { 300 zoomWindow_Position = 1; 301 } 302 } 303 if ($("#content").data('zoomposition') == 'left') 304 { 305 //DONGND:: update position of zoom window with ar language 306 if (prestashop.language.is_rtl == 1) 307 { 308 zoomWindow_Position = 1; 309 } 310 else 311 { 312 zoomWindow_Position = 11; 313 } 314 } 315 if ($("#content").data('zoomposition') == 'top') 316 { 317 zoomWindow_Position = 13; 318 } 319 if ($("#content").data('zoomposition') == 'bottom') 320 { 321 zoomWindow_Position = 7; 322 } 323 324 if (zt == 'in_scrooll') 325 { 326 //DONGND:: scroll to zoom does not work on IE 327 var ua = window.navigator.userAgent; 328 var old_ie = ua.indexOf('MSIE '); 329 var new_ie = ua.indexOf('Trident/'); 330 if (old_ie > 0 || new_ie > 0) // If Internet Explorer, return version number 331 { 332 scroll_zoom = false; 333 } 334 else // If another browser, return 0 335 { 336 scroll_zoom = true; 337 } 338 339 } 340 }; 341 342 if($('#main').hasClass('product-image-gallery')) 343 { 344 lens_FadeIn = false; 345 lens_FadeOut = false;
346 zoomWindow_FadeIn = false; 347 zoomWindow_FadeOut = false; 348 } 349 350 var zoom_config = { 351 responsive : true, 352 cursor: zoom_cursor, 353 scrollZoom: scroll_zoom, 354 scrollZoomIncrement: 0.1, 355 zoomLevel: 1, 356 zoomType: zoom_type, 357 gallery: 'thumb-gallery', 358 lensFadeIn: lens_FadeIn, 359 lensFadeOut: lens_FadeOut, 360 zoomWindowFadeIn: zoomWindow_FadeIn, 361 zoomWindowFadeOut: zoomWindow_FadeOut, 362 zoomWindowWidth: zoomWindow_Width, 363 zoomWindowHeight: zoomWindow_Height, 364 borderColour: '#888', 365 borderSize: 2, 366 zoomWindowOffetx: 0, 367 zoomWindowOffety: 0, 368 zoomWindowPosition: zoomWindow_Position, 369 tint: zoom_tint, 370 }; 371 372 if($('#main').hasClass('product-image-gallery')) 373 { 374 $('img.js-thumb').each(function(){ 375 var parent_e = $(this).parent(); 376 $(this).attr('src', parent_e.data('image')); 377 $(this).data('type-zoom', parent_e.data('zoom-image')); 378 }); 379 380 if($.fn.elevateZoom !== undefined) 381 { 382 $('img.js-thumb').elevateZoom(zoom_config); 383 //DONGND:: fix click a thumb replace all image and add fancybox 384 $('img.js-thumb').bind("click", function(e) { 385 var ez = $(this).data('elevateZoom'); 386 $.fancybox(ez.getGalleryList()); 387 return false; 388 }); 389 } 390 } 391 else 392 { 393 if($.fn.elevateZoom !== undefined) 394 { 395 $("#zoom_product").elevateZoom(zoom_config); 396 397 //pass the images to Fancybox 398 $("#zoom_product").bind("click", function(e) { 399 var ez = $('#zoom_product').data('elevateZoom'); 400 $.fancybox(ez.getGalleryList()); 401 return false; 402 }); 403 } 404 405 } 406} 407 408function initSlickProductThumb(postion, numberimage, numberimage1200, numberimage992, numberimage768, numberimage576, numberimage480 , numberimage360){ 409 var vertical = true; 410 var verticalSwiping = true; 411 //DONGND:: update for rtl 412 var slick_rtl = false; 413 414 if(postion == "bottom"){ 415 vertical = false;
416 verticalSwiping = false; 417 } 418 419 if(postion == 'none'){ 420 vertical = false; 421 verticalSwiping = false; 422 numberimage = numberimage1200 = numberimage992 = numberimage768 = numberimage576 = numberimage480 = numberimage360 = 1; 423 } 424 425 //DONGND:: update for rtl 426 if (!vertical && prestashop.language.is_rtl == 1) 427 { 428 slick_rtl = true; 429 } 430 431 var slider = $('#thumb-gallery'); 432 433 slider.slick({ 434 speed: 300, 435 dots: false, 436 infinite: false, 437 slidesToShow: numberimage, 438 vertical: vertical, 439 verticalSwiping: verticalSwiping, 440 slidesToScroll: 1, 441 rtl: slick_rtl, 442 responsive: [ 443 { 444 breakpoint: 1200, 445 settings: { 446 slidesToShow: numberimage1200, 447 slidesToScroll: 1, 448 } 449 }, 450 { 451 breakpoint: 992, 452 settings: { 453 slidesToShow: numberimage992, 454 slidesToScroll: 1, 455 } 456 }, 457 { 458 breakpoint: 768, 459 settings: { 460 slidesToShow: numberimage768, 461 slidesToScroll: 1 462 } 463 }, 464 { 465 breakpoint: 576, 466 settings: { 467 slidesToShow: numberimage576, 468 slidesToScroll: 1 469 } 470 }, 471 { 472 breakpoint: 480, 473 settings: { 474 slidesToShow: numberimage480, 475 slidesToScroll: 1 476 } 477 }, 478 { 479 breakpoint: 360, 480 settings: { 481 slidesToShow: numberimage360, 482 slidesToScroll: 1 483 } 484 } 485 ] 486 }); 487 $("#thumb-gallery").show(); 488 489 if(postion == 'none') 490 { 491 var slickInstance = slider[0]; 492 var slides = $(slickInstance.slick.$slides); 493 var positionStart = findPosition(slides); 494 var slideCount = slickInstance.slick.slideCount; 495 496 //DONGND:: update slick for case without thubms 497 if ((positionStart + 1) == slideCount){ 498 $('.arrows-product-fake .slick-next').addClass('slick-disabled'); 499 }else if(positionStart == 0){ 500 $('.arrows-product-fake .slick-prev').addClass('slick-disabled'); 501 } 502 503 // active image first load 504 slider.slick('slickGoTo', positionStart); 505 506 $('.arrows-product-fake .slick-next').on( "click", function() { 507 if (!$(this).hasClass('slick-disabled')) 508 { 509 $('.arrows-product-fake .slick-prev').removeClass('slick-disabled'); 510 var positionCurrent = findPosition(slides); 511 if ((positionCurrent + 1) < slideCount) { 512 $(slides[positionCurrent]).removeClass('active'); 513 $(slides[positionCurrent + 1]).addClass('active'); 514 $(slides[positionCurrent + 1]).find('img').trigger("click"); 515 slider.slick('slickNext'); 516 if((positionCurrent + 1) == (slideCount - 1)){ 517 $(this).addClass('slick-disabled'); 518 } 519 } 520 } 521 522 }); 523 524 $('.arrows-product-fake .slick-prev').on( "click", function() { 525 if (!$(this).hasClass('slick-disabled')) 526 { 527 $('.arrows-product-fake .slick-next').removeClass('slick-disabled'); 528 var positionCurrent = findPosition(slides); 529 if ((positionCurrent) > 0) { 530 $(slides[positionCurrent]).removeClass('active'); 531 $(slides[positionCurrent - 1]).addClass('active'); 532 $(slides[positionCurrent - 1]).find('img').trigger("click"); 533 slider.slick('slickPrev'); 534 if((positionCurrent - 1) == 0){ 535 $(this).addClass('slick-disabled'); 536 } 537 } 538 } 539 }); 540 } 541} 542 543function findPosition(slides){ 544 var position; 545 for (var i = 0; i < slides.length; i++) { 546 if ($(slides[i]).hasClass('active')) { 547 position = $(slides[i]).data('slick-index'); 548 return position; 549 } 550 } 551} 552 553//DONGND:: loading quickview 554function actionQuickViewLoading() 555{ 556 $('.quick-view').click(function(){ 557 if (!$(this).hasClass('active')) 558 { 559 $(this).addClass('active'); 560 $(this).find('.leo-quickview-bt-loading').css({'display':'block'}); 561 $(this).find('.leo-quickview-bt-content').hide(); 562 if (typeof check_active_quickview != 'undefined') 563 { 564 clearInterval(check_active_quickview); 565 } 566 567 check_active_quickview = setInterval(function(){ 568 if($('.quickview.modal').length) 569 { 570 $('.quickview.modal').on('hide.bs.modal', function (e) { 571 $('.quick-view.active').find('.leo-quickview-bt-loading').hide(); 572 $('.quick-view.active').find('.leo-quickview-bt-content').show(); 573 $('.quick-view.active').removeClass('active'); 574 }); 575 clearInterval(check_active_quickview); 576 577 //DONGND:: run slick for product thumb - quickview 578 initSlickProductQuickView(); 579 } 580 581 }, 300); 582 583 } 584 }) 585} 586 587$(document).on('click', '.leo_grid', function(e){ 588 e.preventDefault(); 589 $('#js-product-list .product_list').removeClass('list'); 590 $('#js-product-list .product_list').addClass('grid'); 591 592 $(this).parent().find('.leo_list').removeClass('selected'); 593 $(this).addClass('selected'); 594 595 var configName = LEO_COOKIE_THEME +'_grid_list'; 596 $.cookie(configName, 'grid', {expires: 1, path: '/'}); 597}); 598 599$(document).on('click', '.leo_list', function(e){ 600 e.preventDefault(); 601 $('#js-product-list .product_list').removeClass('grid'); 602 $('#js-product-list .product_list').addClass('list'); 603 604 $(this).parent().find('.leo_grid').removeClass('selected'); 605 $(this).addClass('selected'); 606 607 var configName = LEO_COOKIE_THEME +'_grid_list'; 608 $.cookie(configName, 'list', {expires: 1, path: '/'}); 609}); 610 611function setDefaultListGrid() 612{ 613 if ($.cookie(LEO_COOKIE_THEME +'_grid_list') == 'grid') 614 { 615 $('.leo_grid').trigger('click'); 616 } 617 if ($.cookie(LEO_COOKIE_THEME +'_grid_list') == 'list') 618 { 619 $('.leo_list').trigger('click'); 620 } 621} 622
623function processFloatHeader(headerAdd, scroolAction){ 624 //DONGND:: hide search result when enable float header 625 if ($('.ac_results').length) 626 { 627 $('.ac_results').hide(); 628 } 629 630 if(headerAdd){ 631 $("#header").addClass( "navbar-fixed-top" ); 632 var hideheight = $("#header").height()+120; 633 $("#page").css( "padding-top", $("#header").height() ); 634 setTimeout(function(){ 635 $("#page").css( "padding-top", $("#header").height() ); 636 },200); 637 }else{ 638 $("#header").removeClass( "navbar-fixed-top" ); 639 $("#page").css( "padding-top", ''); 640 } 641 642 var pos = $(window).scrollTop(); 643 if( scroolAction && pos >= hideheight ){ 644 $(".header-nav").addClass('hide-bar'); 645 $(".hide-bar").css( "margin-top", - $(".header-nav").height() ); 646 $("#header").addClass("mini-navbar"); 647 }else { 648 $(".header-nav").removeClass('hide-bar'); 649 $(".header-nav").css( "margin-top", 0 ); 650 $("#header").removeClass("mini-navbar"); 651 } 652} 653 654//Float Menu 655function floatHeader(){ 656 if (!$("body").hasClass("keep-header") || $(window).width() <= 990){ 657 return; 658 } 659 660 $(window).resize(function(){ 661 if ($(window).width() <= 990) 662 { 663 processFloatHeader(0,0); 664 } 665 else if ($(window).width() > 990) 666 { 667 if ($("body").hasClass("keep-header")) 668 processFloatHeader(1,1); 669 } 670 }); 671 var headerScrollTimer; 672 673 $(window).scroll(function() { 674 if(headerScrollTimer) { 675 window.clearTimeout(headerScrollTimer); 676 } 677 678 headerScrollTimer = window.setTimeout(function() { 679 if (!$("body").hasClass("keep-header")) return; 680 if($(window).width() > 990){ 681 processFloatHeader(1,1); 682 } 683 }, 100); 684 }); 685} 686 687// Back to top 688function backtotop(){ 689 $("#back-top").hide(); 690 $(window).scroll(function () { 691 if ($(this).scrollTop() > 100) { 692 $('#back-top').fadeIn(); 693 } else { 694 $('#back-top').fadeOut(); 695 } 696 }); 697 698 // scroll body to 0px on click 699 $('#back-top a').click(function () { 700 $('body,html').animate({ 701 scrollTop: 0 702 }, 800); 703 return false; 704 }); 705} 706 707//DONGND:: build slick slider for quickview 708function initSlickProductQuickView(){ 709 $('.quickview.modal .product-thumb-images').imagesLoaded( function(){ 710 if (typeof check_loaded_thumb_quickview != 'undefined') 711 { 712 clearInterval(check_loaded_thumb_quickview); 713 } 714 check_loaded_thumb_quickview = setInterval(function(){ 715 if($('.quickview.modal .product-thumb-images').height() > 0) 716 { 717 $('.quickview.modal .product-thumb-images').fadeIn(); 718 719 clearInterval(check_loaded_thumb_quickview); 720 $('.quickview.modal .product-thumb-images').slick(options_quickview); 721 } 722 }, 300); 723 }); 724 725} 726 727//DONGND:: build slick slider for modal - product page 728function initSlickProductModal(){ 729 $('#product-modal .product-images').imagesLoaded( function(){ 730 if (typeof check_loaded_thumb_modal != 'undefined') 731 { 732 clearInterval(check_loaded_thumb_modal); 733 } 734 check_loaded_thumb_modal = setInterval(function(){ 735 if($('#product-modal .product-images').height() > 0) 736 { 737 $('#product-modal .product-images').fadeIn(); 738 739 clearInterval(check_loaded_thumb_modal); 740 $('#product-modal .product-images').slick(options_modal_product_page); 741 } 742 }, 300); 743 }); 744} 745 746 747//DONGND: fix base prestashop 748$(document).ready(function(){ 749 //DONGND: remove css inline of label 750 $('.product-flag').removeAttr('style'); 751 prestashop.on('updateProductList', function() { 752 //DONGND: remove css inline of label 753 $('.product-flag').removeAttr('style'); 754 }); 755}) 756//Fix translate button choose file to upload: change "Choose file" to choosefile_text 757//Fix filter (category page) does not work on IE change dataset.searchUrl to getAttribute('data-search-url') 758 759 760$().ready(function(){ 761 //btn show menu home 3 762 $('.btn-showmenu').click(function(){ 763 $('body').toggleClass('show-menu'); 764 }) 765 //resize image home 3 766 $(window).resize(function(){ 767 if ($(window).width() > 991) 768 { 769 $('.box-homeh3 .block-carousel-image-container img').height($(window).height()); 770 } 771 else{ 772 $('.box-homeh3 .block-carousel-image-container img').height('auto'); 773 } 774 }); 775 if ($(window).width() > 991) 776 { 777 $('.box-homeh3 .block-carousel-image-container img').height($(window).height()); 778 } 779 else{ 780 $('.box-homeh3 .block-carousel-image-container img').height('auto'); 781 } 782 $(".block-category h1").detach().insertBefore('#wrapper .breadcrumb ol li:first-child'); 783 784 785 $('#leo_search_block_top .title_block').click(function(){ 786 $(this).parent().toggleClass('active'); 787 }); 788 789 790 791 792}); 793 794 795// Click show menu 796 797$(function(){ 798 $('.showmenu').click(function(e) { 799 e.stopPropagation(); 800 if($('.group-nav').hasClass('active-menu')){ 801 $('.group-nav').removeClass('active-menu'); 802 $('.bg-over-lay').removeClass('show-over-lay'); 803 $('.showmenu').removeClass('active'); 804 } 805 else{ 806 $('.group-nav').addClass('active-menu'); 807 $('.bg-over-lay').addClass('show-over-lay'); 808 $('.showmenu').addClass('active'); 809 } 810 }); 811 $('.closemenu').click(function(e) { 812 e.stopPropagation(); 813 if($('.group-nav').hasClass('active-menu') || $('.bg-over-lay').hasClass('show-over-lay')){ 814 $('.group-nav').removeClass('active-menu'); 815 $('.bg-over-lay').removeClass('show-over-lay'); 816 } 817 $("body").find(".showmenu").removeClass("active"); 818 }); 819 //DONGND:: close menu when click out 820 $(document).click(function(event) { 821 if (!$(event.target).closest(".group-nav").length) { 822 $("body").find(".group-nav").removeClass("active-menu"); 823 $("body").find(".bg-over-lay").removeClass("show-over-lay"); 824 $("body").find(".showmenu").removeClass("active"); 825 } 826 }); 827 828}); 829 830 831// clik show poupup Newsletter (home3) 832$(function(){ 833 $('.showpopup').click(function(e) { 834 e.stopPropagation(); 835 if($('.group-newsletter').hasClass('active-popup')){ 836 $('.group-newsletter').removeClass('active-popup'); 837 $('.bg-layout-newsletter').addClass('show'); 838 } 839 else{ 840 $('.group-newsletter').addClass('active-popup'); 841 $('.bg-layout-newsletter').addClass('show'); 842 } 843 }); 844 $('.closepopup').click(function(e) { 845 e.stopPropagation(); 846 if($('.group-newsletter').hasClass('active-popup')){ 847 $('.group-newsletter').removeClass('active-popup'); 848 } 849 if($('.bg-layout-newsletter').hasClass('show')){ 850 $('.bg-layout-newsletter').removeClass('show'); 851 } 852 }); 853 854 //DONGND:: close menu when click out 855 $(document).click(function(event) { 856 if (!$(event.target).closest(".wr-newsletter").length) { 857 $("body").find(".group-newsletter").removeClass("active-popup"); 858 $("body").find(".bg-layout-newsletter").removeClass("show"); 859 } 860 }); 861});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.