1(function($, window){ 2 "use strict"; 3 var arrowWidth = 16; 4 5 $.fn.resizeselect = function(settings) { 6 7 return this.each( function() { 8 9 $(this).change( function(){ 10 11 var $this = $(this); 12 13 // create test element 14 var text = $this.find("option:selected").text(); 15 var $test = $("<span>").html(text); 16 17 // add to body, get width, and get out 18 $test.appendTo('body'); 19 var width = $test.width(); 20 $test.remove(); 21 22 // set select width 23 $this.width(width + arrowWidth); 24 25 // run on start 26 }).change(); 27 28 }); 29 }; 30 31 $.fn.arrangeObjects = function(wrapWith, maxCols) { 32 33 this.each(function() { 34 if ($(this).parent(wrapWith).length) $(this).unwrap(); 35 }); 36 37 this.parent().each(function () { 38 var $subnodes = $(this).children(); 39 40 // true will cause counter increment 41 // false will cause counter decrement 42 var inc = true; 43 var cols = []; 44 45 for (var i = 0; i < maxCols; i++) { 46 cols.push($('<ul></ul>')); 47 cols[i].appendTo($(this)); 48 } 49 50 function sortByHeight(a, b) { 51 return $(a).height() > $(b).height() ? 0 : 1; 52 } 53 54 $subnodes = $subnodes.sort(sortByHeight); 55 56 var i = 0; 57 $subnodes.each(function () { 58 // logic for left and right boundry 59 if (i < 0 || i === maxCols) { 60 inc = !inc; 61 // this will cause node to be added once again to the same column 62 inc ? i++ : i--; 63 } 64 65 cols[i].append($(this)); 66 67 inc ? i++ : i--; 68 }); 69 }); 70 }; 71 72 // run by default 73 $( "select.resizeselect" ).resizeselect(); 74 75})(jQuery, window); 76 77(function($) { 78 'use strict'; 79 80 81 /*===================================================================================*/ 82 /* WOW 83 /*===================================================================================*/ 84 85 $(document).ready(function () { 86 new WOW().init(); 87 }); 88 89 /*===================================================================================*/ 90 /* OWL CAROUSEL 91 /*===================================================================================*/ 92 93 $(document).ready(function () { 94 95 var dragging = true; 96 var owlElementID = "#owl-main"; 97 98 function fadeInReset() { 99 if (!dragging) { 100 $(owlElementID + " .caption .fadeIn-1, " + owlElementID + " .caption .fadeIn-2, " + owlElementID + " .caption .fadeIn-3," + owlElementID + " .caption .fadeIn-4").stop().delay(800).animate({ opacity: 0 }, { duration: 400, easing: "easeInCubic" }); 101 } 102 else { 103 $(owlElementID + " .caption .fadeIn-1, " + owlElementID + " .caption .fadeIn-2, " + owlElementID + " .caption .fadeIn-3," + owlElementID + " .caption .fadeIn-4").css({ opacity: 0 }); 104 } 105 } 106 107 function fadeInDownReset() { 108 if (!dragging) { 109 $(owlElementID + " .caption .fadeInDown-1, " + owlElementID + " .caption .fadeInDown-2, " + owlElementID + " .caption .fadeInDown-3," + owlElementID + " .caption .fadeInDown-4").stop().delay(800).animate({ opacity: 0, top: "-15px" }, { duration: 400, easing: "easeInCubic" }); 110 } 111 else { 112 $(owlElementID + " .caption .fadeInDown-1, " + owlElementID + " .caption .fadeInDown-2, " + owlElementID + " .caption .fadeInDown-3," + owlElementID + " .caption .fadeInDown-4").css({ opacity: 0, top: "-15px" }); 113 } 114 } 115 116 function fadeInUpReset() { 117 if (!dragging) { 118 $(owlElementID + " .caption .fadeInUp-1, " + owlElementID + " .caption .fadeInUp-2, " + owlElementID + " .caption .fadeInUp-3," + owlElementID + " .caption .fadeInUp-4").stop().delay(800).animate({ opacity: 0, top: "15px" }, { duration: 400, easing: "easeInCubic" }); 119 } 120 else { 121 $(owlElementID + " .caption .fadeInUp-1, " + owlElementID + " .caption .fadeInUp-2, " + owlElementID + " .caption .fadeInUp-3," + owlElementID + " .caption .fadeInUp-4").css({ opacity: 0, top: "15px" }); 122 } 123 } 124 125 function fadeInLeftReset() { 126 if (!dragging) { 127 $(owlElementID + " .caption .fadeInLeft-1, " + owlElementID + " .caption .fadeInLeft-2, " + owlElementID + " .caption .fadeInLeft-3, " + owlElementID + " .caption .fadeInLeft-4").stop().delay(800).animate({ opacity: 0, left: "15px" }, { duration: 400, easing: "easeInCubic" }); 128 } 129 else { 130 $(owlElementID + " .caption .fadeInLeft-1, " + owlElementID + " .caption .fadeInLeft-2, " + owlElementID + " .caption .fadeInLeft-3," + owlElementID + " .caption .fadeInLeft-4").css({ opacity: 0, left: "15px" }); 131 } 132 } 133 134 function fadeInRightReset() { 135 if (!dragging) { 136 $(owlElementID + " .caption .fadeInRight-1, " + owlElementID + " .caption .fadeInRight-2, " + owlElementID + " .caption .fadeInRight-3," + owlElementID + " .caption .fadeInRight-4").stop().delay(800).animate({ opacity: 0, left: "-15px" }, { duration: 400, easing: "easeInCubic" }); 137 } 138 else { 139 $(owlElementID + " .caption .fadeInRight-1, " + owlElementID + " .caption .fadeInRight-2, " + owlElementID + " .caption .fadeInRight-3," + owlElementID + " .caption .fadeInRight-4").
139css({ opacity: 0, left: "-15px" }); 140 } 141 } 142 143 function fadeIn() { 144 $(owlElementID + " .active .caption .fadeIn-1").stop().delay(500).animate({ opacity: 1 }, { duration: 800, easing: "easeOutCubic" }); 145 $(owlElementID + " .active .caption .fadeIn-2").stop().delay(700).animate({ opacity: 1 }, { duration: 800, easing: "easeOutCubic" }); 146 $(owlElementID + " .active .caption .fadeIn-3").stop().delay(1000).animate({ opacity: 1 }, { duration: 800, easing: "easeOutCubic" }); 147 $(owlElementID + " .active .caption .fadeIn-4").stop().delay(1000).animate({ opacity: 1 }, { duration: 800, easing: "easeOutCubic" }); 148 } 149 150 function fadeInDown() { 151 $(owlElementID + " .active .caption .fadeInDown-1").stop().delay(500).animate({ opacity: 1, top: "0" }, { duration: 800, easing: "easeOutCubic" }); 152 $(owlElementID + " .active .caption .fadeInDown-2").stop().delay(700).animate({ opacity: 1, top: "0" }, { duration: 800, easing: "easeOutCubic" }); 153 $(owlElementID + " .active .caption .fadeInDown-3").stop().delay(1000).animate({ opacity: 1, top: "0" }, { duration: 800, easing: "easeOutCubic" }); 154 $(owlElementID + " .active .caption .fadeInDown-4").stop().delay(1000).animate({ opacity: 1, top: "0" }, { duration: 800, easing: "easeOutCubic" }); 155 } 156 157 function fadeInUp() { 158 $(owlElementID + " .active .caption .fadeInUp-1").stop().delay(500).animate({ opacity: 1, top: "0" }, { duration: 800, easing: "easeOutCubic" }); 159 $(owlElementID + " .active .caption .fadeInUp-2").stop().delay(700).animate({ opacity: 1, top: "0" }, { duration: 800, easing: "easeOutCubic" }); 160 $(owlElementID + " .active .caption .fadeInUp-3").stop().delay(1000).animate({ opacity: 1, top: "0" }, { duration: 800, easing: "easeOutCubic" }); 161 $(owlElementID + " .active .caption .fadeInUp-4").stop().delay(1000).animate({ opacity: 1, top: "0" }, { duration: 800, easing: "easeOutCubic" }); 162 } 163 164 function fadeInLeft() { 165 $(owlElementID + " .active .caption .fadeInLeft-1").stop().delay(500).animate({ opacity: 1, left: "0" }, { duration: 800, easing: "easeOutCubic" }); 166 $(owlElementID + " .active .caption .fadeInLeft-2").stop().delay(700).animate({ opacity: 1, left: "0" }, { duration: 800, easing: "easeOutCubic" }); 167 $(owlElementID + " .active .caption .fadeInLeft-3").stop().delay(1000).animate({ opacity: 1, left: "0" }, { duration: 800, easing: "easeOutCubic" }); 168 $(owlElementID + " .active .caption .fadeInLeft-4").stop().delay(1000).animate({ opacity: 1, left: "0" }, { duration: 800, easing: "easeOutCubic" }); 169 } 170 171 function fadeInRight() { 172 $(owlElementID + " .active .caption .fadeInRight-1").stop().delay(500).animate({ opacity: 1, left: "0" }, { duration: 800, easing: "easeOutCubic" }); 173 $(owlElementID + " .active .caption .fadeInRight-2").stop().delay(700).animate({ opacity: 1, left: "0" }, { duration: 800, easing: "easeOutCubic" }); 174 $(owlElementID + " .active .caption .fadeInRight-3").stop().delay(1000).animate({ opacity: 1, left: "0" }, { duration: 800, easing: "easeOutCubic" }); 175 $(owlElementID + " .active .caption .fadeInRight-4").stop().delay(1000).animate({ opacity: 1, left: "0" }, { duration: 800, easing: "easeOutCubic" }); 176 } 177 178 $(owlElementID).owlCarousel({ 179 180 animateOut: 'fadeOut', 181 autoplay: true, 182 autoplayTimeout: 5000, 183 autoplayHoverPause: false, 184 stopOnHover: true, 185 loop: true, 186 navRewind: true, 187 items: 1, 188 dots: true, 189 nav:false, 190 //navText: ["<i class='icon fa fa-angle-left'></i>", "<i class='icon fa fa-angle-right'></i>"], 191 lazyLoad: true, 192 stagePadding: 0, 193 responsive : { 194 0 : { 195 items : 1, 196 }, 197 480: { 198 items : 1, 199 }, 200 768 : { 201 items : 1, 202 }, 203 992 : { 204 items : 1, 205 }, 206 1199 : { 207 items : 1, 208 }, 209 onTranslate : function(){ 210 echo.render(); 211 } 212 }, 213 214 215 onInitialize : function() { 216 fadeIn(); 217 fadeInDown(); 218 fadeInUp(); 219 fadeInLeft(); 220 fadeInRight(); 221 }, 222 223 onInitialized : function() { 224 fadeIn(); 225 fadeInDown(); 226 fadeInUp(); 227 fadeInLeft(); 228 fadeInRight(); 229 }, 230 231 onResize : function() { 232 fadeIn(); 233 fadeInDown(); 234 fadeInUp(); 235 fadeInLeft(); 236 fadeInRight(); 237 }, 238 239 onResized : function() { 240 fadeIn(); 241 fadeInDown(); 242 fadeInUp(); 243 fadeInLeft(); 244 fadeInRight(); 245 }, 246 247 onRefresh : function() { 248 fadeIn(); 249 fadeInDown(); 250 fadeInUp(); 251 fadeInLeft(); 252 fadeInRight(); 253 }, 254 255 onRefreshed : function() { 256 fadeIn(); 257 fadeInDown(); 258 fadeInUp(); 259 fadeInLeft(); 260 fadeInRight(); 261 }, 262 263 onUpdate : function() { 264 fadeIn(); 265 fadeInDown(); 266 fadeInUp(); 267 fadeInLeft(); 268 fadeInRight(); 269 }, 270 271 onUpdated : function() { 272 fadeIn(); 273 fadeInDown(); 274 fadeInUp(); 275 fadeInLeft(); 276 fadeInRight(); 277 }, 278 279 onDrag : function() { 280 dragging = true; 281 }, 282 283 onTranslate : function() { 284 fadeIn(); 285 fadeInDown(); 286 fadeInUp(); 287 fadeInLeft(); 288 fadeInRight(); 289 }, 290 onTranslated : function() { 291 fadeIn(); 292 fadeInDown(); 293 fadeInUp(); 294 fadeInLeft(); 295 fadeInRight(); 296 }, 297 298 onTo : function() { 299 fadeIn(); 300 fadeInDown(); 301 fadeInUp(); 302 fadeInLeft(); 303 fadeInRight(); 304 }, 305 306 onChanged : function() { 307 fadeInReset(); 308 fadeInDownReset(); 309 fadeInUpReset(); 310 fadeInLeftReset(); 311 fadeInRightReset(); 312 dragging = false;
313 } 314 }); 315 316 var $owl_recently_added_products_carousel = $( '#recently-added-products-carousel .owl-carousel'); 317 $owl_recently_added_products_carousel.on( 'initialized.owl.carousel translated.owl.carousel', function() { 318 var $this = $(this); 319 $this.find( '.owl-item.last-active' ).each( function() { 320 $(this).removeClass( 'last-active' ); 321 }); 322 $(this).find( '.owl-item.active' ).last().addClass( 'last-active' ); 323 }); 324 $owl_recently_added_products_carousel.owlCarousel({ 325 "items":"6", 326 "nav":true, 327 "slideSpeed":300, 328 "dots":true, 329 "rtl":false, 330 "paginationSpeed":400, 331 "navText":["",""], 332 "margin":0, 333 "touchDrag":true, 334 responsive : { 335 0 : { 336 items : 1, 337 }, 338 480: { 339 items : 2, 340 }, 341 768 : { 342 items : 2, 343 }, 344 992 : { 345 items : 3, 346 }, 347 1200 : { 348 items : 6, 349 }, 350 onTranslate : function(){ 351 echo.render(); 352 } 353 }, 354 355 }); 356 357 var $owl_recommended_product = $( '#recommended-product .owl-carousel'); 358 $owl_recommended_product.on( 'initialized.owl.carousel translated.owl.carousel', function() { 359 var $this = $(this); 360 $this.find( '.owl-item.last-active' ).each( function() { 361 $(this).removeClass( 'last-active' ); 362 }); 363 $(this).find( '.owl-item.active' ).last().addClass( 'last-active' ); 364 }); 365 $owl_recommended_product.owlCarousel({ 366 "items":"4", 367 "nav":false, 368 "slideSpeed":300, 369 "dots":"true", 370 "rtl":false, 371 "paginationSpeed":400, 372 "navText":["",""], 373 "margin":0, 374 "touchDrag":false, 375 "responsive":{ 376 "0":{ 377 "items":1 378 }, 379 "480":{ 380 "items":3 381 }, 382 "768":{ 383 "items":2 384 }, 385 "992":{ 386 "items":3 387 }, 388 "1200":{ 389 "items":4 390 } 391 }, 392 393 }); 394 395 var $owl_home_v3_carousel_tabs = $( '.home-v3-owl-carousel-tabs .owl-carousel') 396 $owl_home_v3_carousel_tabs.on( 'initialized.owl.carousel translated.owl.carousel', function() { 397 var $this = $(this); 398 $this.find( '.owl-item.last-active' ).each( function() { 399 $(this).removeClass( 'last-active' ); 400 }); 401 $(this).find( '.owl-item.active' ).last().addClass( 'last-active' ); 402 }); 403 $owl_home_v3_carousel_tabs.owlCarousel({ 404 "items":4, 405 "nav":false, 406 "autoplay": true, 407 "autoplayTimeout": 5000, 408 "autoplayHoverPause": true, 409 "loop": true, 410 "slideSpeed":300, 411 "dots":true, 412 "rtl":false, 413 "paginationSpeed":400, 414 "navText":["",""], 415 "margin":0, 416 "touchDrag":true, 417 "responsive":{ 418 "0":{ 419 "items":1 420 }, 421 "480":{ 422 "items":1 423 }, 424 "768":{ 425 "items":2 426 }, 427 "992":{ 428 "items":3 429 }, 430 "1200":{ 431 "items":4 432 } 433 }, 434 }); 435 436 //slider ban chay 437 var $owl_home_v3_bn_carousel_tabs = $( '.home-v3-bn-owl-carousel-tabs .owl-carousel') 438 $owl_home_v3_bn_carousel_tabs.on( 'initialized.owl.carousel translated.owl.carousel', function() { 439 var $this = $(this); 440 $this.find( '.owl-item.last-active' ).each( function() { 441 $(this).removeClass( 'last-active' ); 442 }); 443 $(this).find( '.owl-item.active' ).last().addClass( 'last-active' ); 444 }); 445 $owl_home_v3_bn_carousel_tabs.owlCarousel({ 446 "items":4, 447 "nav":false, 448 "autoplay": true, 449 "autoplayTimeout": 5000, 450 "autoplayHoverPause": true, 451 "loop": true, 452 "slideSpeed":300, 453 "dots":true, 454 "rtl":false, 455 "paginationSpeed":400, 456 "navText":["",""], 457 "margin":0, 458 "touchDrag":true, 459 "responsive":{ 460 "0":{ 461 "items":1 462 }, 463 "480":{ 464 "items":1 465 }, 466 "768":{ 467 "items":2 468 }, 469 "992":{ 470 "items":3 471 }, 472 "1200":{ 473 "items":4 474 } 475 }, 476 }); 477
478 //slider khuyen mai (event) 479 var $owl_home_v3_event_carousel_tabs = $( '.home-v3-event-owl-carousel-tabs .owl-carousel') 480 $owl_home_v3_event_carousel_tabs.on( 'initialized.owl.carousel translated.owl.carousel', function() { 481 var $this = $(this); 482 $this.find( '.owl-item.last-active' ).each( function() { 483 $(this).removeClass( 'last-active' ); 484 }); 485 $(this).find( '.owl-item.active' ).last().addClass( 'last-active' ); 486 }); 487 $owl_home_v3_event_carousel_tabs.owlCarousel({ 488 "items":4, 489 "nav":false, 490 "autoplay": true, 491 "autoplayTimeout": 5000, 492 "autoplayHoverPause": true, 493 "loop": true, 494 "slideSpeed":300, 495 "dots":true, 496 "rtl":false, 497 "paginationSpeed":400, 498 "navText":["",""], 499 "margin":0, 500 "touchDrag":true, 501 "responsive":{ 502 "0":{ 503 "items":1 504 }, 505 "480":{ 506 "items":1 507 }, 508 "768":{ 509 "items":2 510 }, 511 "992":{ 512 "items":3 513 }, 514 "1200":{ 515 "items":4 516 } 517 }, 518 }); 519 520 var $owl_home_v2_carousel_tabs = $( '.home-v2-owl-carousel-tabs .owl-carousel') 521 $owl_home_v2_carousel_tabs.on( 'initialized.owl.carousel translated.owl.carousel', function() { 522 var $this = $(this); 523 $this.find( '.owl-item.last-active' ).each( function() { 524 $(this).removeClass( 'last-active' ); 525 }); 526 $(this).find( '.owl-item.active' ).last().addClass( 'last-active' ); 527 }); 528 $owl_home_v2_carousel_tabs.owlCarousel({ 529 "items":3, 530 "nav":false, 531 "slideSpeed":300, 532 "dots":true, 533 "rtl":false, 534 "paginationSpeed":400, 535 "navText":["",""], 536 "margin":0, 537 "touchDrag":true, 538 "responsive":{ 539 "0":{ 540 "items":2 541 }, 542 "480":{ 543 "items":2 544 }, 545 "768":{ 546 "items":2 547 }, 548 "992":{ 549 "items":3 550 }, 551 "1200":{ 552 "items":3 553 } 554 }, 555 }); 556 557 var $owl_product_carousel_with_image = $( '#products-carousel-with-umage .owl-carousel') 558 $owl_product_carousel_with_image.on( 'initialized.owl.carousel translated.owl.carousel', function() { 559 var $this = $(this); 560 $this.find( '.owl-item.last-active' ).each( function() { 561 $(this).removeClass( 'last-active' ); 562 }); 563 $(this).find( '.owl-item.active' ).last().addClass( 'last-active' ); 564 }); 565 $owl_product_carousel_with_image.owlCarousel({ 566 "items":2, 567 "nav":false, 568 "slideSpeed":300, 569 "dots":true, 570 "rtl":false, 571 "paginationSpeed":400, 572 "navText":["",""], 573 "margin":30, 574 "touchDrag":true, 575 "responsive":{ 576 "0":{ 577 "items":1 578 }, 579 "480":{ 580 "items":1 581 }, 582 "768":{ 583 "items":1 584 }, 585 "992":{ 586 "items":2 587 }, 588 "1200":{ 589 "items":2 590 } 591 }, 592 }); 593 594 var $owl_homev3_products_cards_carousel = $( '#homev3-products-cards-carousel .owl-carousel') 595 $owl_homev3_products_cards_carousel.on( 'initialized.owl.carousel translated.owl.carousel', function() { 596 var $this = $(this); 597 $this.find( '.owl-item.last-active' ).each( function() { 598 $(this).removeClass( 'last-active' ); 599 }); 600 $(this).find( '.owl-item.active' ).last().addClass( 'last-active' ); 601 }); 602 $owl_homev3_products_cards_carousel.owlCarousel({ 603 "items":1, 604 "nav":false, 605 "slideSpeed":300, 606 "dots":true, 607 "rtl":false, 608 "paginationSpeed":400, 609 "navText":["",""], 610 "margin":0, 611 "touchDrag":true 612 }); 613 614 var $owl_product_category_carousel = $( '#product-category-carousel .owl-carousel'); 615 $owl_product_category_carousel.on( 'initialized.owl.carousel translated.owl.carousel', function() { 616 var $this = $(this); 617 $this.find( '.owl-item.last-active' ).each( function() { 618 $(this).removeClass( 'last-active' ); 619 }); 620 $(this).find( '.owl-item.active' ).last().addClass( 'last-active' ); 621 }); 622 $owl_product_category_carousel.owlCarousel({ 623 "items":6, 624 "nav":false, 625 "slideSpeed":300, 626 "dots":true, 627 "rtl":false, 628 "paginationSpeed":400, 629 "navText":["",""], 630 "margin":0, 631 "touchDrag":true, 632 "responsive":{ 633 "0":{ 634 "items":1 635 }, 636 "480":{ 637 "items":1 638 }, 639 "768":{ 640 "items":2 641 }, 642 "992":{ 643 "items":3 644 }, 645 "1200":{ 646 "items":6 647 } 648 }, 649 650 }); 651
652 $('.home-carousel-tabs').owlCarousel({ 653 "items":4, 654 "nav":false, 655 "slideSpeed":300, 656 "dots":true, 657 "rtl":false, 658 "paginationSpeed":400, 659 "navText":["",""], 660 "margin":0, 661 "touchDrag":true 662 663 }); 664 665 666 $('#owl-brands').owlCarousel({ 667 "items":5, 668 "navRewind":true, 669 "autoplayHoverPause":true, 670 "nav":true,"stagePadding":1, 671 "dots":false, 672 "rtl":false, 673 "autoplay": true, 674 "autoplayTimeout": 5000, 675 "autoplayHoverPause": true, 676 "loop": true, 677 "navText":["<i class=\"fa fa-chevron-left\"><\/i>", 678 "<i class=\"fa fa-chevron-right\"><\/i>"], 679 "touchDrag":false, 680 "responsive":{ 681 "0":{ 682 "items":1 683 }, 684 "480":{ 685 "items":1 686 }, 687 "768":{ 688 "items":2 689 }, 690 "992":{ 691 "items":3 692 }, 693 "1200":{ 694 "items":5 695 } 696 }, 697 }); 698 699 $('.home-v2-categories-products').owlCarousel({ 700 "items":4, 701 "nav":false, 702 "slideSpeed":300, 703 "dots":true, 704 "rtl":false, 705 "paginationSpeed":400, 706 "navText":["",""], 707 "margin":0, 708 "touchDrag":true, 709 "responsive":{ 710 "0":{ 711 "items":2 712 }, 713 "480":{ 714 "items":2 715 }, 716 "768":{ 717 "items":2 718 }, 719 "992":{ 720 "items":3 721 }, 722 "1200":{ 723 "items":4 724 } 725 }, 726 }); 727 728 $('.recently-added-products').owlCarousel({ 729 "items":1, 730 "nav":false, 731 "slideSpeed":300, 732 "dots":true, 733 "rtl":false, 734 "paginationSpeed":400, 735 "navText":["",""], 736 "margin":0, 737 "touchDrag":true, 738 "responsive":{ 739 "0":{ 740 "items":1 741 }, 742 "480":{ 743 "items":1 744 }, 745 "768":{ 746 "items":2 747 }, 748 "992":{ 749 "items":3 750 }, 751 "1200":{ 752 "items":1 753 } 754 }, 755 }); 756 757 $('#owl-carousel-media').owlCarousel({ 758 items : 1, 759 nav : false, 760 slideSpeed : 300, 761 dots: true, 762 paginationSpeed : 400, 763 navText: ["", ""], 764 responsive:{ 765 0:{ 766 items:1 767 }, 768 600:{ 769 items:1 770 }, 771 1000:{ 772 items:1 773 } 774 } 775 }); 776 777 778 $('.products-carousel-widget').owlCarousel({ 779 items : 1, 780 nav : true, 781 slideSpeed : 300, 782 dots: false, 783 paginationSpeed : 400, 784 navText: ["", ""], 785 autoHeight: false, 786 responsive:{ 787 0:{ 788 items:1 789 }, 790 600:{ 791 items:1 792 }, 793 1000:{ 794 items:1 795 } 796 } 797 }); 798 799 $('.blog-carousel-widget').owlCarousel({ 800 items : 1, 801 nav : true, 802 slideSpeed : 300, 803 dots: false, 804 paginationSpeed : 400, 805 navText: ["", ""], 806 autoHeight: false, 807 responsive:{ 808 0:{ 809 items:1 810 }, 811 600:{ 812 items:1 813 }, 814 1000:{ 815 items:1 816 } 817 } 818 }); 819 820 821 $('.home-v1-product-cards-carousel').owlCarousel({ 822 "items":1, 823 "nav":false, 824 "slideSpeed":300, 825 "dots":true, 826 "rtl":false, 827 "paginationSpeed":400, 828 "navText":["",""], 829 "margin":0, 830 "touchDrag":true, 831 "autoplay": true, 832 "autoplayTimeout": 5000, 833 "autoplayHoverPause": true, 834 "loop": true 835 }); 836 837 //Mua nhieu ban phim 838 $('.home-v1-bn-product-cards-carousel').owlCarousel({ 839 "items":1, 840 "nav":false, 841 "slideSpeed":300, 842 "dots":true, 843 "rtl":false, 844 "paginationSpeed":400, 845 "navText":["",""], 846 "margin":0, 847 "touchDrag":true, 848 "autoplay": true, 849 "autoplayTimeout": 5000, 850 "autoplayHoverPause": true, 851 "loop": true 852 }); 853 //Mua nhieu phu kien 854 $('.home-v1-pk-product-cards-carousel').owlCarousel({ 855 "items":1, 856 "nav":false, 857 "slideSpeed":300, 858 "dots":true, 859 "rtl":false, 860 "paginationSpeed":400, 861 "navText":["",""], 862 "margin":0, 863 "touchDrag":true, 864 "autoplay": true, 865 "autoplayTimeout": 5000, 866 "autoplayHoverPause": true, 867 "loop": true 868 }); 869
870 $('.onsale-product-carousel').owlCarousel({ 871 "items":1, 872 "nav":false, 873 "slideSpeed":300, 874 "dots":true, 875 "rtl":false, 876 "paginationSpeed":400, 877 "navText":["",""], 878 "margin":0, 879 "touchDrag":true 880 }); 881 }); 882 883 /*===================================================================================*/ 884 /* Accessories Product Check 885 /*===================================================================================*/ 886 887 jQuery(document).ready(function($) { 888 889 function accessory_checked_count(){ 890 var product_count = 0; 891 $('.accessory-checkbox .product-check').each(function() { 892 if( $(this).is(':checked') ) { 893 product_count++; 894 } 895 }); 896 return product_count; 897 } 898 899 function accessory_checked_total_price(){ 900 var total_price = 0; 901 $('.accessory-checkbox .product-check').each(function() { 902 if( $(this).is(':checked') ) { 903 total_price += parseFloat( $(this).data( 'price' ) ); 904 } 905 }); 906 return total_price; 907 } 908 909 function accessory_checked_product_ids(){ 910 var product_ids = []; 911 $('.accessory-checkbox .product-check').each(function() { 912 if( $(this).is(':checked') ) { 913 product_ids.push( $(this).data( 'product-id' ) ); 914 } 915 }); 916 return product_ids; 917 } 918 919 function accessory_unchecked_product_ids(){ 920 var product_ids = []; 921 $('.accessory-checkbox .product-check').each(function() { 922 if( ! $(this).is(':checked') ) { 923 product_ids.push( $(this).data( 'product-id' ) ); 924 } 925 }); 926 return product_ids; 927 } 928 929 function accessory_checked_variable_product_ids(){ 930 var variable_product_ids = []; 931 $('.accessory-checkbox .product-check').each(function() { 932 if( $(this).is(':checked') && $(this).data( 'product-type' ) == 'variable' ) { 933 variable_product_ids.push( $(this).data( 'product-id' ) ); 934 } 935 }); 936 return variable_product_ids; 937 } 938 939 function accessory_is_variation_selected(){ 940 if( $(".single_add_to_cart_button").is(":disabled") ) { 941 return false; 942 } 943 return true; 944 } 945 946 function accessory_refresh_fragments( response ){ 947 var this_page = window.location.toString(); 948 var fragments = response.fragments; 949 var cart_hash = response.cart_hash; 950 951 // Block fragments class 952 if ( fragments ) { 953 $.each( fragments, function( key ) { 954 $( key ).addClass( 'updating' ); 955 }); 956 } 957 958 // Replace fragments 959 if ( fragments ) { 960 $.each( fragments, function( key, value ) { 961 $( key ).replaceWith( value ); 962 }); 963 } 964 965 // Cart page elements 966 $( '.shop_table.cart' ).load( this_page + ' .shop_table.cart:eq(0) > *', function() { 967 968 $( '.shop_table.cart' ).stop( true ).css( 'opacity', '1' ).unblock(); 969 970 $( document.body ).trigger( 'cart_page_refreshed' ); 971 }); 972 973 $( '.cart_totals' ).load( this_page + ' .cart_totals:eq(0) > *', function() { 974 $( '.cart_totals' ).stop( true ).css( 'opacity', '1' ).unblock(); 975 }); 976 } 977 978 $( '.accessory-checkbox .product-check' ).on( "click", function() { 979 $.ajax({ 980 cache:false, 981 url: "http://demo2.transvelo.in/electro/wp-admin/admin-ajax.php", 982 success:function(result){ 983 var previous_price = $( 'span.total-price-html .amount' ).text().replace( /\.|\,/g, '' ); 984 var current_price = accessory_checked_total_price().toFixed(2).replace(/./g, function(c, i, a) { 985 return i && c !== "." && ((a.length - i) % 3 === 0) ? ',' + c : c; 986 }); 987 total_price = previous_price.replace( /\d+/g, current_price ); 988 $( 'span.total-price-html .amount' ).html( total_price ); 989 $( 'span.total-products' ).html( accessory_checked_count() ); 990 991 var unchecked_product_ids = accessory_unchecked_product_ids(); 992 $( '.accessories ul.products > li' ).each(function() { 993 $(this).show(); 994 for (var i = 0; i < unchecked_product_ids.length; i++ ) { 995 if( $(this).hasClass( 'post-'+unchecked_product_ids[i] ) ) { 996 $(this).hide(); 997 } 998 } 999 }); 1000 } 1001 }) 1002 }); 1003 1004 $('.accessories-add-all-to-cart .add-all-to-cart').on( "click", function() { 1005 var accerories_all_product_ids = accessory_checked_product_ids(); 1006 var accerories_variable_product_ids = accessory_checked_variable_product_ids(); 1007 if( accerories_all_product_ids.length === 0 ) { 1008 var accerories_alert_msg = '<div class="woocommerce-error">No Products selected.</div>'; 1009 } else if( accerories_variable_product_ids.length > 0 && accessory_is_variation_selected() === false ) { 1010 var accerories_alert_msg = '<div class="woocommerce-error">Product Variation does not selected.</div>'; 1011 } else { 1012 for (var i = 0; i < accerories_all_product_ids.length; i++ ) { 1013 if( ! $.inArray( accerories_all_product_ids[i], accerories_variable_product_ids ) ) { 1014 var variation_id = $('.variations_form .variations_button').find('input[name^=variation_id]').val(); 1015 var variation = {}; 1016 if( $( '.variations_form' ).find('select[name^=attribute]').length ) { 1017 $( '.variations_form' ).find('select[name^=attribute]').each(function() { 1018 var attribute = $(this).attr("name"); 1019 var attributevalue = $(this).val(); 1020 variation[attribute] = attributevalue; 1021 }); 1022 1023 } else { 1024 1025 $( '.variations_form' ).find('.select').each(function() { 1026 var attribute = $(this).attr("data-attribute-name"); 1027 var attributevalue = $(this).find('.selected').attr('data-name'); 1028 variation[attribute] = attributevalue; 1029 }); 1030 1031 } 1032 $.ajax({ 1033 type: "POST", 1034 async: false, 1035 url: "http://demo2.transvelo.in/electro/wp-admin/admin-ajax.php", 1036 data: { 'action': "electro_variable_add_to_cart", 'product_id': accerories_all_product_ids[i], 'variation_id': variation_id, 'variation': variation }, 1037 success : function( response ) { 1038 accessory_refresh_fragments( response ); 1039 } 1040 }) 1041 } else { 1042 $.ajax({ 1043 type: "POST", 1044 async: false, 1045 url: "http://demo2.transvelo.in/electro/wp-admin/admin-ajax.php", 1046 data: { 'action': "woocommerce_add_to_cart", 'product_id': accerories_all_product_ids[i] }, 1047 success : function( response ) { 1048 accessory_refresh_fragments( response ); 1049 } 1050 }) 1051 } 1052 } 1053 var accerories_alert_msg = '<div class="woocommerce-message">Products was successfully added to your cart. <a class="button wc-forward" href="http://demo2.transvelo.in/electro/cart/">View Cart</a></div>'; 1054 } 1055 $( '.electro-wc-message' ).html(accerories_alert_msg); 1056 }); 1057 1058 }); 1059 1060 1061 /*===================================================================================*/ 1062 /* Set Height of Products li 1063 /*===================================================================================*/ 1064
1065 // these are (ruh-roh) globals. You could wrap in an 1066 // immediately-Invoked Function Expression (IIFE) if you wanted to... 1067 var currentTallest = 0, 1068 currentRowStart = 0, 1069 rowDivs = new Array(); 1070 1071 function setConformingHeight(el, newHeight) { 1072 // set the height to something new, but remember the original height in case things change 1073 el.data("originalHeight", (el.data("originalHeight") == undefined) ? (el.height()) : (el.data("originalHeight"))); 1074 el.height(newHeight); 1075 } 1076 1077 function getOriginalHeight(el) { 1078 // if the height has changed, send the originalHeight 1079 return (el.data("originalHeight") == undefined) ? (el.height()) : (el.data("originalHeight")); 1080 } 1081 1082 function columnConform() { 1083 1084 $( '.product-outer' ).each( function() { 1085 var $this = $(this); 1086 if ( 0 != $this.height() ){ 1087 $this.height( $this.height() ); 1088 } 1089 }); 1090 1091 } 1092 1093 $( window ).on( 'resize', function() { 1094 columnConform(); 1095 }); 1096 1097 $( '.ec-tabs > li > a' ).on( 'click', function() { 1098 if ( location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname ) { 1099 var target = $(this.hash); 1100 target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); 1101 1102 if ( target.length ) { 1103 $('html, body').animate({ 1104 scrollTop: target.offset().top 1105 }, 1000); 1106 //return false; 1107 } 1108 } 1109 }); 1110 1111 $('a[data-toggle="tab"]').on( 'shown.bs.tab', function (e) { 1112 1113 if ( e.target == '#grid' || e.target == '#grid-extended' ) { 1114 columnConform(); 1115 } 1116 }); 1117 1118 /*===================================================================================*/ 1119 /* YITH Wishlist 1120 /*===================================================================================*/ 1121 1122 $(document).ready( function() { 1123 1124 $( '.add_to_wishlist' ).on( 'click', function() { 1125 $( this ).closest( '.images-and-summary' ).block(); 1126 $( this ).closest( '.product-inner' ).block(); 1127 $( this ).closest( '.product-list-view-inner' ).block(); 1128 $( this ).closest( '.product-item-inner' ).block(); 1129 }); 1130 1131 $( '.yith-wcwl-wishlistaddedbrowse > .feedback' ).on( 'click', function() { 1132 var browseWishlistURL = $( this ).next().attr( 'href' ); 1133 window.location.href = browseWishlistURL; 1134 }); 1135 1136 1137 }); 1138 1139 $( document ).on( 'added_to_wishlist', function() { 1140 $( '.images-and-summary' ).unblock(); 1141 $( '.product-inner' ).unblock(); 1142 $( '.product-list-view-inner' ).unblock(); 1143 $( '.product-item-inner' ).unblock(); 1144 }); 1145 1146 /*===================================================================================*/ 1147 /* LAZY LOAD IMAGES USING ECHO 1148 /*===================================================================================*/ 1149 1150 echo.init({ 1151 offset: 100, 1152 throttle: 250, 1153 unload: false 1154 }); 1155 1156 /*===================================================================================*/ 1157 /* WooCompare 1158 /*===================================================================================*/ 1159 1160 1161 $( document ).on( 'click', '.add-to-compare-link:not(.added)', function(e) { 1162 1163 e.preventDefault(); 1164 1165 var button = $(this), 1166 data = { 1167 _yitnonce_ajax: yith_woocompare.nonceadd, 1168 action: yith_woocompare.actionadd, 1169 id: button.data('product_id'), 1170 context: 'frontend' 1171 }, 1172 widget_list = $('.yith-woocompare-widget ul.products-list'); 1173 1174 // add ajax loader 1175 if( typeof woocommerce_params != 'undefined' ) { 1176 button.closest( '.images-and-summary' ).block(); 1177 button.closest( '.product-inner' ).block(); 1178 button.closest( '.product-list-view-inner' ).block(); 1179 button.closest( '.product-item-inner' ).block(); 1180 widget_list.block(); 1181 } 1182 1183 $.ajax({ 1184 type: 'post', 1185 url: yith_woocompare.ajaxurl.toString().replace( '%%endpoint%%', yith_woocompare.actionadd ), 1186 data: data, 1187 dataType: 'json', 1188 success: function(response){ 1189 1190 if( typeof woocommerce_params != 'undefined' ) { 1191 $( '.images-and-summary' ).unblock(); 1192 $( '.product-inner' ).unblock(); 1193 $( '.product-list-view-inner' ).unblock(); 1194 $( '.product-item-inner' ).unblock(); 1195 widget_list.unblock() 1196 } 1197 1198 button.addClass('added') 1199 .attr( 'href', mc_options.compare_page_url ) 1200 .text( yith_woocompare.added_label ); 1201 1202 // add the product in the widget 1203 widget_list.html( response.widget_table ); 1204 } 1205 }); 1206 }); 1207 1208 /*===================================================================================*/ 1209 /* Add to Cart animation 1210 /*===================================================================================*/ 1211 1212 1213 $( 'body' ).on( 'adding_to_cart', function( e, $btn, data){ 1214 $btn.closest( 'li.product' ).block(); 1215 }); 1216 1217 $( 'body' ).on( 'added_to_cart', function(){ 1218 $( 'li.product' ).unblock(); 1219 return false;
1220 }); 1221 1222 1223 $( document ).ready( function() { 1224 1225 var is_rtl = false; 1226 1227 var hash_value = window.location.hash; 1228 1229 switch( hash_value ) { 1230 case '#grid-extended': 1231 case '#list-view': 1232 case '#list-view-small': 1233 case '#grid': 1234 $( '.shop-view-switcher a[href="' + hash_value +'"]' ).tab( 'show' ); 1235 break; 1236 case '#tab-accessories': 1237 case '#tab-description': 1238 case '#tab-specification': 1239 case '#tab-reviews': 1240 $( '.wc-tabs a[href="' + hash_value + '"]' ).trigger( 'click' ); 1241 break; 1242 } 1243 1244 // Adjust Product Item heights 1245 columnConform(); 1246 1247 // Set Home Page Sidebar margin-top 1248 var departments_menu_height = $( '.page-template-template-homepage-v2 .departments-menu > li > ul.dropdown-menu' ).height(), 1249 home_fullwidth_slider_height = $( '.page-template-template-homepage-v2 .home-v2-slider' ).height(), 1250 sidebar_margin_top = 0; 1251 1252 if ( departments_menu_height > home_fullwidth_slider_height ) { 1253 sidebar_margin_top = departments_menu_height + 24; 1254 } else { 1255 sidebar_margin_top = home_fullwidth_slider_height; 1256 } 1257 1258 sidebar_margin_top = sidebar_margin_top + 35; 1259 $( '.page-template-template-homepage-v2 #sidebar').css( 'margin-top', sidebar_margin_top ); 1260 1261 // Detect wrapping of price 1262 $( '.price-add-to-cart > .price' ).each( function() { 1263 var $this = $( this ); 1264 if ( $this[0].scrollWidth > $this.innerWidth() ) { 1265 //Text has over-flowed 1266 $this.find( '.electro-price' ).css( 'position', 'relative' ); 1267 if( is_rtl ){ 1268 $this.find( 'del' ).attr( 'style', 'position:absolute;right:0;top:-14px;'); 1269 }else { 1270 $this.find( 'del' ).attr( 'style', 'position:absolute;left:0;top:-14px;'); 1271 } 1272 } 1273 }); 1274 1275 // Vertical Menu dropdown min-height 1276 var $vertical_menu = $( '.vertical-menu' ), 1277 vertical_menu_height = $vertical_menu.height(), 1278 vm_header_height = 52.25, 1279 dd_menu_min_height = vertical_menu_height - vm_header_height; 1280 1281 $vertical_menu.find( '.dropdown > .dropdown-menu' ).each( function() { 1282 $(this).css( 'min-height', dd_menu_min_height ); 1283 $(this).find( '.menu-item-object-static_block' ).css( 'min-height', dd_menu_min_height ); 1284 }); 1285 1286 var $list_group_dd = $( '.vertical-menu > .list-group-item > .dropdown-menu' ), 1287 list_group_dd_style = $list_group_dd.attr( 'style' ), 1288 list_group_dd_height = 0; 1289 1290 $list_group_dd.css({ 1291 visibility: 'hidden', 1292 display: 'none' 1293 }); 1294 1295 list_group_dd_height = $list_group_dd.height() + 15; 1296 1297 $list_group_dd.attr( 'style', list_group_dd_style ? list_group_dd_style : '' ); 1298 1299 $list_group_dd.find( '.dropdown-menu' ).each( function() { 1300 $(this).css( 'min-height', list_group_dd_height ); 1301 $(this).find( '.menu-item-object-static_block' ).css( 'min-height', list_group_dd_height ); 1302 }); 1303 1304 // Departments menu Height 1305 var $departments_menu_dropdown = $( '.departments-menu-dropdown' ), 1306 departments_menu_dropdown_height = $departments_menu_dropdown.height(); 1307 1308 $departments_menu_dropdown.find( '.dropdown > .dropdown-menu' ).each( function() { 1309 $(this).find( '.menu-item-object-static_block' ).css( 'min-height', departments_menu_dropdown_height + 24 ); 1310 $(this).css( 'min-height', departments_menu_dropdown_height + 28 ); 1311 }); 1312 1313 $( '.vertical-menu, .departments-menu-dropdown' ).on( 'mouseleave', function() { 1314 var $this = $(this); 1315 $this.removeClass( 'animated-dropdown' ); 1316 }); 1317 1318 $( '.vertical-menu .menu-item-has-children, .departments-menu-dropdown .menu-item-has-children' ).on({ 1319 mouseenter: function() { 1320 var $this = $(this), 1321 $dropdown_menu = $this.find( '.dropdown-menu' ), 1322 $vertical_menu = $this.parents( '.vertical-menu' ), 1323 $departments_menu = $this.parents( '.departments-menu-dropdown' ), 1324 css_properties = { 1325 width: 540, 1326 opacity: 1 1327 }, 1328 animation_duration = 300, 1329 has_changed_width = true, 1330 animated_class = '', 1331 $container = ''; 1332 1333 if ( $vertical_menu.length > 0 ) { 1334 $container = $vertical_menu; 1335 } else if ( $departments_menu.length > 0 ) { 1336 $container = $departments_menu; 1337 } 1338 1339 if ( $this.hasClass( 'yamm-tfw' ) ) { 1340 css_properties.width = 540; 1341 1342 if ( $departments_menu.length > 0 ) { 1343 css_properties.width = 900; 1344 } 1345 } else if ( $this.hasClass( 'yamm-fw' ) ) { 1346 css_properties.width = 900; 1347 } else if ( $this.hasClass( 'yamm-hw' ) ) { 1348 css_properties.width = 450; 1349 } else { 1350 css_properties.width = 277; 1351 } 1352 1353 $dropdown_menu.css( { 1354 visibility: 'visible', 1355 display: 'block' 1356 } ); 1357 1358 if ( ! $container.hasClass( 'animated-dropdown' ) ) { 1359 $dropdown_menu.animate( css_properties, animation_duration, function() { 1360 $container.addClass( 'animated-dropdown' ); 1361 }); 1362 } else { 1363 $dropdown_menu.css( css_properties ); 1364 } 1365 }, mouseleave: function() { 1366 $(this).find( '.dropdown-menu' ).css({ 1367 visibility: 'hidden', 1368 opacity: 0, 1369 width: 0, 1370 display: 'none' 1371 }); 1372 } 1373 }); 1374 1375 // Owl Carousel
1376 $( '.slider-next' ).on( "click", function() { 1377 var owl = $( $( this ).data( 'target' ) + ' .owl-carousel' ); 1378 owl.trigger( 'next.owl.carousel' ); 1379 return false; 1380 }); 1381 1382 $( '.slider-prev' ).on( "click", function() { 1383 var owl = $( $( this ).data( 'target' ) + ' .owl-carousel' ); 1384 owl.trigger( 'prev.owl.carousel' ); 1385 return false; 1386 }); 1387 1388 // Animate on scroll into view 1389 $( '.animate-in-view' ).each( function() { 1390 var $this = $(this), animation = $this.data( 'animation' ); 1391 if( typeof $this !== 'undefined' ) { 1392 $this.waypoint( function(e) { 1393 $(this).addClass( animation + ' animated' ); 1394 }, { 1395 triggerOnce: true, 1396 offset: '90%' 1397 }); 1398 } 1399 }); 1400 1401 1402 1403 /*===================================================================================*/ 1404 /* Electro Product Gallery Carousel 1405 /*===================================================================================*/ 1406 1407 $( '.single-product .electro-gallery' ).each( function() { 1408 var $sync1 = $(this).children('.thumbnails-single'); 1409 var $sync2 = $(this).children('.thumbnails-all'); 1410 var flag = false; 1411 var duration = 300; 1412 1413 $sync1.owlCarousel( { 1414 items: 1, 1415 margin: 0, 1416 dots: false, 1417 nav: false, 1418 rtl: is_rtl, 1419 responsive:{ 1420 0:{ 1421 items:1 1422 }, 1423 480:{ 1424 items:1 1425 }, 1426 768:{ 1427 items:1 1428 }, 1429 } 1430 }); 1431 1432 $sync1.on('changed.owl.carousel', function (e) { 1433 if (!flag) { 1434 flag = true; 1435 $sync2.trigger('to.owl.carousel', [e.item.index, duration, true]); 1436 flag = false; 1437 } 1438 $sync2.find(".owl-item").removeClass("synced").eq(e.item.index).addClass("synced"); 1439 }); 1440 1441 $sync2.on('initialized.owl.carousel',function (e) { 1442 $sync2.find(".owl-item").eq(0).addClass("synced"); 1443 }); 1444 1445 var thumbnail_column_class = $sync2.attr( 'class' ); 1446 var cols = parseInt( thumbnail_column_class.replace( 'thumbnails-all columns-', '' ) ); 1447 1448 $sync2.owlCarousel( { 1449 items: cols, 1450 margin: 8, 1451 dots: true, 1452 nav: false, 1453 rtl: is_rtl, 1454 responsive:{ 1455 0:{ 1456 items:1 1457 }, 1458 480:{ 1459 items:3 1460 }, 1461 768:{ 1462 items:cols 1463 }, 1464 } 1465 }); 1466 1467 $sync2.on('click', 'a', function (e) { 1468 e.preventDefault(); 1469 }); 1470 1471 $sync2.on('click', '.owl-item', function () { 1472 $sync1.trigger('to.owl.carousel', [$(this).index(), duration, true]); 1473 }); 1474 1475 $sync2.on('changed.owl.carousel', function (e) { 1476 if (!flag) { 1477 flag = true; 1478 $sync1.trigger('to.owl.carousel', [e.item.index, duration, true]); 1479 flag = false; 1480 } 1481 }); 1482 }); 1483 1484 1485 $(".electro-store-directory .product-categories > li").arrangeObjects('ul', 4); 1486 1487 1488 /*===================================================================================*/ 1489 /* PRODUCT CATEGORIES TOGGLE 1490 /*===================================================================================*/ 1491 1492 $('.product-categories .show-all-cat-dropdown').each(function(){ 1493 if( $(this).siblings('ul').length > 0 ) { 1494 var $childIndicator = $('<span class="child-indicator"><i class="fa fa-angle-right"></i></span>'); 1495 1496 $(this).siblings('ul').hide(); 1497 if($(this).siblings('ul').is(':visible')){ 1498 $childIndicator.addClass( 'open' ); 1499 $childIndicator.html('<i class="fa fa-angle-up"></i>'); 1500 } 1501 1502 $(this).on( 'click', function(){ 1503 $(this).siblings('ul').toggle( 'fast', function(){ 1504 if($(this).is(':visible')){ 1505 $childIndicator.addClass( 'open' ); 1506 $childIndicator.html('<i class="fa fa-angle-up"></i>'); 1507 }else{ 1508 $childIndicator.removeClass( 'open' ); 1509 $childIndicator.html('<i class="fa fa-angle-right"></i>'); 1510 } 1511 }); 1512 return false;
1513 }); 1514 $(this).append($childIndicator); 1515 } 1516 }); 1517 1518 $('.cat-item > a').each(function(){ 1519 if( $(this).siblings('ul.children').length > 0 ) { 1520 var $childIndicator = $('<span class="child-indicator"><i class="fa fa-angle-right"></i></span>'); 1521 1522 $(this).siblings('.children').hide(); 1523 $('.current-cat > .children').show(); 1524 $('.current-cat-parent > .children').show(); 1525 if($(this).siblings('.children').is(':visible')){ 1526 $childIndicator.addClass( 'open' ); 1527 $childIndicator.html('<i class="fa fa-angle-up"></i>'); 1528 } 1529 1530 $childIndicator.on( 'click', function(){ 1531 $(this).parent().siblings('.children').toggle( 'fast', function(){ 1532 if($(this).is(':visible')){ 1533 $childIndicator.addClass( 'open' ); 1534 $childIndicator.html('<i class="fa fa-angle-up"></i>'); 1535 }else{ 1536 $childIndicator.removeClass( 'open' ); 1537 $childIndicator.html('<i class="fa fa-angle-right"></i>'); 1538 } 1539 }); 1540 return false; 1541 }); 1542 $(this).prepend($childIndicator); 1543 } else { 1544 $(this).prepend('<span class="no-child"></span>'); 1545 } 1546 }); 1547 }); 1548 1549})(jQuery);
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.