1(function ($) { 2 'use strict'; 3 4 var GeneralHeader = function () { 5 6 var GENERAL_MEDIAQUERY_CHANGE = 'GENERAL_MEDIAQUERY_CHANGE'; 7 var GENERAL_MEDIAQUERY_CHECK = 'GENERAL_MEDIAQUERY_CHECK'; 8 9 var $ = jQuery; 10 var currentMediaQuery = null; 11 var mediaQueries = { 12 'mobile': { 13 min: 0, 14 max: 660 15 }, 16 'tablet': { 17 min: 661, 18 max: 1023 19 }, 20 'desktop': { 21 min: 1024, 22 max: 40000 23 } 24 } 25 26 $('p:empty:not([class])').remove(); 27 $('h1:empty:not([class])').remove(); 28 $('h2:empty:not([class])').remove(); 29 $('h3:empty:not([class])').remove(); 30 $('h4:empty:not([class])').remove(); 31 $('h5:empty:not([class])').remove(); 32 $('h6:empty:not([class])').remove(); 33 34 function checkOnWindowResize(callback) { 35 for (var param in mediaQueries) { 36 if (mediaQueries.hasOwnProperty(param)) { 37 if ( $(window).width() <= mediaQueries[param].max && $(window).width() >= mediaQueries[param].min ) { 38 if (callback && typeof callback === 'function') { 39 callback(param); 40 } 41 else { 42 if (param !== currentMediaQuery || currentMediaQuery === null) { 43 currentMediaQuery = param; 44 Events.publish(GENERAL_MEDIAQUERY_CHANGE, [param]); 45 } 46 } 47 48 Events.publish('EQUALIZE_COLS', [param]); 49 } 50 } 51 } 52 } 53 54 function onReady() { 55 $('.uniform-me').uniform(); 56 57 // $(window).resize(_.debounce(equalizeCols, 300)); 58 setTimeout(function() { 59 equalizeCols(); 60 }, 200); 61 62 // Events 63 Events.subscribe('EQUALIZE_COLS', equalizeCols); 64 Events.subscribe(GENERAL_MEDIAQUERY_CHECK, checkOnWindowResize); 65 66 $(window).resize(checkOnWindowResize); 67 } 68 69 function equalizeCols () { 70 console.log('equalizeCols'); 71 var colsInRow, colCount, $cols, $colsSelected, heights, max; 72 var $forEqualize = $('.equalize-cols').not('.not-equalize .container .container-wrapper'); 73 74 $forEqualize.each(function () { 75 // if ( !$(this).hasClass('equalized') ) { 76 var max = 0; 77 var totalCols = 0; 78 var $cols = $(this).find('.default-module-grid--twelve__a'); 79 var $toEqualize = []; 80 81 $cols.each(function () { 82 var colType = $(this).attr('class'); 83 var currentCols = 0; 84 85 if ($(this).hasClass('default-module-grid--twelve__a')) { 86 87 $toEqualize.push($(this)); 88 89 if (colType.match(/(default-module-grid--twelve__a-cols-five)/)) { 90 currentCols = 2.4; 91 } 92 else { 93 colType = colType.match(/(default-module-grid--twelve__a-)+[0-9]{1,2}/); 94 colType = colType[0]; 95 currentCols = Number(colType.replace(/default-module-grid--twelve__a-/, '')); 96 // Hacemos que los contenidos wysiwyg-content no esten al 100% de alto 97 $(this).find('.wysiwyg-content').css('height', 'auto'); 98 $(this).find('.content-wrapper').css('height', 'auto'); 99 } 100 101 totalCols += currentCols; 102 103 if ($(this).height() > max) { 104 max = $(this).height(); 105 } 106 107 // $(this).find('.content-wrapper').height(max); 108 109 if (totalCols >= 12) { 110 for (var col in $toEqualize) { 111 if ($toEqualize.hasOwnProperty(col)) { 112 $toEqualize[col].find('.content-wrapper').height(max); 113 } 114 } 115 max = 0; 116 totalCols = 0; 117 $toEqualize = []; 118 } 119 120 // Borramos el estilo dado por esta función al wysiwyg-content 121 $(this).find('.wysiwyg-content').removeAttr('style'); 122 123 Events.publish('EQUALIZE_COLS_FINISHED', []); 124 } 125 }); 126 127 $(this).addClass('equalized'); 128 // } 129 }); 130 131 // $view.find('.static-content .col .content-wrapper').css('min-height', ''); 132 // var colHeight = getBigestElement($view.find('.static-content .col'), '.content-wrapper'); 133 // $view.find('.static-content .col .content-wrapper').css('min-height', colHeight); 134 } 135 136 $(onReady); 137 } 138 139 GeneralHeader(); 140 141})(jQuery); 142 143 144/** 145 * SearchContainer 146 * Vista para controlar los resultados por instant search de las búsquedas 147 * 148 * 149 */ 150;(function ($) { 151 152 var SearchContainer = function (referer) { 153 154 var $referer = referer; 155 var id = null; 156 var $box = null; 157 var $content = null; 158 var interval = null; 159 160 function openContent() { 161 if ($content.html() != '') { 162 setPosition(); 163 $box.addClass('opened').removeClass('closed'); 164 $box.height($content.parent().outerHeight()); 165 } 166 } 167 168 function closeSearchBox() { 169 $box.removeClass('opened').height(0); 170 clearInterval(interval); 171 // $content.delay(500).html(''); 172 } 173 174 function bodyClicked(e) { 175 closeSearchBox(); 176 } 177 178 function attachEvents() { 179 $('div.wrapper').on('click', bodyClicked); 180 $(window).scroll(setPosition); 181 $(window).resize(setPosition); 182 } 183 184 function setPosition() { 185 $box.css({ 186 'top': $referer.offset().top + $referer.outerHeight(), 187 'left': $referer.offset().left, 188 'width': $referer.outerWidth() 189 }); 190 } 191 192 function createContainer() { 193 $box = $('<div id="' + id + '" class="box-instant-search closed"><div class="box-instant-search-wrapper"><div class="box-instant-search-content"></div></div></div>'); 194 $content = $box.find('.box-instant-search-content'); 195 $('body').append($box); 196 setPosition(); 197 attachEvents(); 198 } 199 200 function setContent(content) { 201 clearInterval(interval); 202 $content.html(''); 203 $content.append(content); 204 $box.height($content.parent().outerHeight()); 205 setPosition(); 206 $box.removeClass('closed').addClass('opened'); 207 // Activamos el intervalo 208 clearInterval(interval); 209 interval = null; 210 interval = setInterval(setPosition, 100); 211 } 212 213 function guid() { 214 function s4() { 215 return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); 216 } 217 return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); 218 } 219 220 var instance = { 221 init: function () { 222 id = guid(); 223 createContainer(); 224 225 return this; 226 }, 227 setContent: function(content) { 228 setContent(content); 229 230 return this; 231 }, 232 close: function () { 233 if ($box.hasClass('opened')) { 234 closeSearchBox(); 235 } 236 237 return this; 238 }, 239 openContent: function () { 240 openContent(); 241 } 242 }; 243 244 return instance.init(); 245 } 246 247 window.SearchContainer = SearchContainer; 248 249})(jQuery); 250 251 252/** 253 * InstantSearch 254 * Control del instant search 255 * 256 * 257 */ 258;(function ($) { 259 'use strict'; 260 261 var InstantSearch = function (view) { 262 263 var $form = null; 264 var $view = null; 265 var data = null; 266 var $input = null; 267 var currentRequestAjax = null; 268 var searchContainer; 269 var lastSearch = null; 270 271 function getData() { 272 data = { 273 'action': $form.find('input[name="action"]').val(), 274 'search_term': $form.find('input[name="s"]').val() 275 }; 276 277 // Recuperamos el post_type 278 var post_type = $form.find('input[name="post_type"]') ? $form.find('input[name="post_type"]').val() : null; 279 if ( post_type && post_type != '' ) { 280 data.post_type = $form.find('input[name="post_type"]').val() 281 } 282 283 // Recuperamos la categoria en caso de tenerla seleccionad
283a 284 var product_cat = $form.find('select[name="product_cat"]') ? $form.find('select[name="product_cat"]').val() : null; 285 if ( product_cat && product_cat != '' ) { 286 data.product_cat = product_cat; 287 } 288 289 // Recuperamos los posts_per_page 290 var posts_per_page = $form.find('input[name="posts_per_page"]') ? $form.find('input[name="posts_per_page"]').val() : null; 291 if ( posts_per_page && posts_per_page != '' ) { 292 data.posts_per_page = posts_per_page; 293 } 294 295 return data; 296 } 297 298 function search() { 299 300 var ajaxurl = window.ajaxUrl; 301 302 currentRequestAjax = jQuery.ajax({ 303 url: ajaxurl, 304 type: 'POST', 305 data: getData(), 306 beforeSend: function() { 307 if (currentRequestAjax) 308 currentRequestAjax.abort(); 309 // @test: 310 // searchContainer.setContent('<ul><li><a href="http://caritas.web.dev/producto/publicacion-fisico/"><div class="title">Publicación fÃsico</div><div class="meta-info"><span class="categoria">Estudio e Investigación</span></div></a></li><li><a href="http://caritas.web.dev/producto/publicacion-fisico-2/"><div class="title">Publicación virtual 2</div><div class="meta-info"><span class="categoria">Estudio e Investigación</span><span class="edicion">3era edición</span></div></a></li><li><a href="http://caritas.web.dev/producto/publicacion-fisico-3/"><div class="title">Publicación fÃsico 3</div><div class="meta-info"><span class="categoria">Foessa</span></div></a></li><li><a href="http://caritas.web.dev/producto/publicacion-fisico/"><div class="title">Publicación fÃsico</div><div class="meta-info"><span class="categoria">Estudio e Investigación</span></div></a></li><li><a href="http://caritas.web.dev/producto/publicacion-fisico-3/"><div class="title">Publicación fÃsico 3</div><div class="meta-info"><span class="categoria">Foessa</span></div></a></li><li><a href="http://caritas.web.dev/producto/publicacion-fisico-3/"><div class="title">Publicación fÃsico 3</div><div class="meta-info"><span class="categoria">Foessa</span></div></a></li><li><a href="http://caritas.web.dev/producto/publicacion-fisico-3/"><div class="title">Publicación fÃsico 3</div><div class="meta-info"><span class="categoria">Foessa</span></div></a></li><li><a href="http://caritas.web.dev/producto/publicacion-fisico-3/"><div class="title">Publicación fÃsico 3</div><div class="meta-info"><span class="categoria">Foessa</span></div></a></li><li><a href="http://caritas.web.dev/producto/publicacion-fisico-3/"><div class="title">Publicación fÃsico 3</div><div class="meta-info"><span class="categoria">Foessa</span></div></a></li><li><a href="http://caritas.web.dev/producto/publicacion-fisico-3/"><div class="title">Publicación fÃsico 3</div><div class="meta-info"><span class="categoria">Foessa</span></div></a></li></ul>'); 311 // @endtest; 312 if (lastSearch) { 313 searchContainer.openContent(); 314 } 315 }, 316 success: function(response) { 317 if (response) { 318 searchContainer.setContent(response); 319 } 320 } 321 }); 322 } 323 324 function onSearchKeyUp(e) { 325 var $obj = $(this); 326 327 if (!$input) { 328 $input = $obj; 329 searchContainer = new SearchContainer($input); 330 } 331 332 if (!lastSearch) { 333 lastSearch = $input.val(); 334 } 335 336 if (lastSearch && lastSearch !== $input.val()) { 337 if ($input.val().length > 3) { 338 search($input.val()); 339 } 340 else { 341 searchContainer.close(); 342 } 343 } 344 } 345 346 function onSearchKeyDown(e) { 347 // Paramos el evento de la tecla enter 348 /*if (e.which == 13) { 349 e.preventDefault(); 350 e.stopPropagation(); 351 }*/ 352 } 353 354 function attachEvents() { 355 //$form.find('input[name="s"]').on('keyup', onSearchKeyUp); 356 //$form.find('input[name="s"]').on('keydown', onSearchKeyDown); 357 } 358 359 function init(view) { 360 361 } 362 363 var instance = { 364 init: function (view) { 365 $view = view; 366 $form = $view.find('form.search-form'); 367 368 $form.find('select').uniform(); 369 370 attachEvents(); 371 return this; 372 } 373 } 374 375 return instance.init(view); 376 } 377 378 379 380 // Instances 381 382 var instances = []; 383 384 function onReady() { 385 if ($('section.archive-products-tpl').length > 0) { 386 instances.push(new InstantSearch($('section.archive-products-tpl'))); 387 } 388 389 if ($('div.panel.panel--search').length > 0) { 390 instances.push(new InstantSearch($('div.panel.panel--search'))); 391 } 392 } 393 394 $(onReady); 395 396})(jQuery); 397(function ($) { 398 'use strict'; 399 400 var Menu = function () { 401 402 var $view, 403 instances = []; 404 405 function initInstance(view) { 406 407 var $view = view; 408 var panelsOpen = false;
409 var animating = false; 410 // Menu close and open 411 var menuCloseIntervalID = null; 412 413 // Añado una clase personalizada para los botones de "Hazte socio" y "Colabora" porque lo necesitan para monitorizarlo con Google Tag Manager. 414 $('.open-shopping.menu a').addClass('menu'); 415 416 function onArrowTop(e) { 417 if (e) { e.preventDefault(); } 418 $('html, body').animate({scrollTop : 0},800); 419 } 420 421 function showTopArrow() { 422 $('div#top-arrow').addClass('opened'); 423 $('div#top-arrow a').off().on('click', onArrowTop); 424 } 425 426 function hideTopArrow() { 427 $('div#top-arrow').removeClass('opened'); 428 $('div#top-arrow a').off(); 429 } 430 431 function onMobileMenuToggle(e) { 432 if (e) { e.preventDefault(); } 433 // console.log('Menu::onMobileMenuToggle'); 434 435 // Si hay algún panel abierto la funcionalidad cambia 436 437 if (panelsOpen) { 438 $(window).scroll(onMobileResize); 439 mobileCloseOtherPanles(); 440 return; 441 } 442 443 if ($view.hasClass('open')) { 444 onMobileCloseAllSubmenus(); 445 $(this).removeClass('close'); 446 447 $view.removeClass('open'); 448 $view.css('overflow', 'hidden'); 449 450 var tween = TweenLite.to($('header#menu'), 0.4, { 451 height: 71, 452 ease: Power2.easeOut 453 }); 454 455 var tween = TweenLite.to($('a.second-makeyoupartner'), 0.4, { 456 right: 0, 457 ease: Power2.easeOut 458 }); 459 460 $('html').removeClass('pack'); 461 } 462 else { 463 $(this).addClass('close'); 464 $('header#menu').addClass('open'); 465 466 var tweenMakeyoupartner = TweenLite.to($('a.second-makeyoupartner'), 0.8, { 467 right: -200, 468 ease: Power2.easeOut 469 }); 470 471 $view.css({ 472 height: '100%', 473 overflow: 'auto' 474 }); 475 476 $('html').addClass('pack'); 477 } 478 } 479 480 function onMobileShowMenus(e) { 481 // console.log('onMobileShowMenus'); 482 if (e) { 483 e.preventDefault(); 484 e.stopPropagation(); 485 } 486 487 var $container = $(this).parents('li'); 488 489 if ($container.hasClass('opened')) { 490 onMobileCloseAllSubmenus(); 491 } 492 else { 493 onMobileCloseAllSubmenus(); 494 $container.addClass('opened'); 495 var $submenu = $container.find('ul'); 496 var $link = $($container.find('a').get(0)); 497 var max = 0; 498 max += $submenu.height(); 499 max += $link.height(); 500 // $items.each(function () { 501 // max += $(this).height(); 502 // }); 503 504 $container 505 .css({ 506 height: max 507 }); 508 } 509 } 510 511 function onMobileShowSearchForm(e) { 512 // console.log('onMobileShowSearchForm'); 513 if (e) { 514 e.preventDefault(); 515 } 516 517 $(window).off('scroll', onMobileResize); 518 519 onMobileCloseAllSubmenus(); 520 521 if (panelsOpen) { 522 mobileCloseOtherPanles(); 523 } 524 525 $view.animate({ 526 scrollTop: 0 527 }, 300, function () { 528 $view.css('overflow', 'hidden'); 529 $view.find('.panel.panel--search') 530 .addClass('opened') 531 .css('display', 'block') 532 .animate({ 533 "height": "100%" 534 }, 535 300, function () { 536 panelsOpen = true; 537 }); 538 }); 539 } 540 541 function onMobileShowLanguages(e) { 542 // console.log('onMobileShowLanguages'); 543 if (e) { 544 e.preventDefault(); 545 } 546 547 onMobileCloseAllSubmenus(); 548 549 if (panelsOpen) { 550 mobileCloseOtherPanles(); 551 } 552 553 $view.animate({ 554 scrollTop: 0 555 }, 300, function () { 556 $view.css('overflow', 'hidden'); 557 $view.find('.panel.panel--language') 558 .addClass('opened') 559 .css('display', 'block') 560 .animate({ 561 "height": "100%" 562 }, 563 300, function () { 564 panelsOpen = true; 565 }); 566 }); 567 } 568 569 function onMobileResize(e) { 570 // console.log('onMobileResize'); 571 e.preventDefault(); 572 573 if ($(window).scrollTop() > $(window).height()) { 574 showTopArrow(); 575 } 576 else { 577 hideTopArrow(); 578 } 579 580 if ($view.hasClass('open')) { 581 $view.css({ 582 height: '100%', 583 overflow: 'auto' 584 }); 585 } 586 587 } 588 589 function onMobileCloseAllSubmenus() { 590 // console.log('onMobileCloseAllSubmenus'); 591 $('#main-bar ul > li').each(function () { 592 if ($(this).hasClass('opened')) { 593 $(this).removeClass('opened'); 594 $(this).css({ 595 height: $($(this).find('a').get(0)).height() 596 }); 597 } 598 }); 599 } 600 601 function mobileCloseOtherPanles() { 602 // console.log('mobileCloseOtherPanles'); 603 $view.find('.panel.opened') 604 .removeClass('opened') 605 .css('display', 'block') 606 .animate({ 607 "height": "0%" 608 }, 609 300, function () { 610 // $view.css('overflow', 'initial'); 611 panelsOpen = false;
612 $view.find('.elastic-col').css('position', 'initial'); 613 $view.find('.elastic-col').css('overflow', 'auto'); 614 $view.removeAttr('style'); 615 }); 616 } 617 618 function desktopCloseOtherPanles() { 619 // console.log('desktopCloseOtherPanles'); 620 $view.find('.panel.opened') 621 .removeClass('opened') 622 .css('display', 'block') 623 .animate({ 624 "height": 0 625 }, 626 300, function () { 627 // $view.css('overflow', 'initial'); 628 panelsOpen = false; 629 $view.find('.elastic-col').css('position', 'initial'); 630 $view.find('.elastic-col').css('overflow', 'auto'); 631 }); 632 } 633 634 function onDesktopShowSearchForm(e) { 635 // console.log('onDesktopShowSearchForm'); 636 if (e) { 637 e.preventDefault(); 638 } 639 640 onMobileCloseAllSubmenus(); 641 642 if (panelsOpen) { 643 mobileCloseOtherPanles(); 644 } 645 646 $view.find('.elastic-col').css('position', 'relative'); 647 $view.css('overflow', 'hidden'); 648 $view.find('.panel.panel--search') 649 // .css('left', $view.find('.fixed-col').width()) 650 .addClass('opened') 651 .css('display', 'block') 652 .animate({ 653 "height": '100%' 654 }, 655 400, function () { 656 panelsOpen = true; 657 $view.find('.panel.panel--search').find('.btn__close') 658 .off() 659 .on('click', function (e) { 660 e.preventDefault(); 661 mobileCloseOtherPanles(); 662 }); 663 }); 664 } 665 666 function onDesktopShowLanguages(e) { 667 if (e) { 668 e.preventDefault(); 669 } 670 671 onMobileCloseAllSubmenus(); 672 673 if (panelsOpen) { 674 desktopCloseOtherPanles(); 675 } 676 677 $view.find('.elastic-col').css('position', 'relative'); 678 $view.css('overflow', 'hidden'); 679 $view.find('.panel.panel--language') 680 // .css('left', $view.find('.fixed-col').width()) 681 .addClass('opened') 682 .css('display', 'block') 683 .animate({ 684 "height": '100%' 685 }, 686 400, function () { 687 panelsOpen = true; 688 $view.find('.panel.panel--language').find('.btn__close') 689 .off() 690 .on('click', function (e) { 691 e.preventDefault(); 692 desktopCloseOtherPanles(); 693 }); 694 }); 695 } 696 697 function onDesktopScroll(e) { 698 if (e) e.preventDefault(); 699 700 if ($(document).scrollTop() > ($view.height() * 2) && $view.hasClass('sticky') === false && animating === false) { 701 animating = true; 702 703 $view.stop().animate({ 704 top: -140 705 }, 400, function () { 706 $view.addClass('sticky'); 707 708 $view.animate({ 709 top: 0 710 }, 400, function () { 711 showTopArrow(); 712 animating = false; 713 onDesktopScroll(); 714 }); 715 }); 716 } 717 else if ($(document).scrollTop() < ($view.height() * 2) && animating === false && $view.hasClass('sticky')) { 718 animating = true; 719 720 $view.stop().animate({ 721 top: -140 722 }, 400, function () { 723 $view.removeClass('sticky'); 724 725 $view.animate({ 726 top: 0 727 }, 400, function () { 728 hideTopArrow(); 729 animating = false; 730 onDesktopScroll(); 731 }); 732 }); 733 } 734 } 735 736 /** 737 * onDesktopMouseOver 738 * @param {Event} e 739 * @return {null} 740 */ 741 function onDesktopMouseOver(e) { 742 if (e) { e.preventDefault(); e.stopPropagation(); } 743 744 // Borramos el intervalo 745 if (menuCloseIntervalID) { 746 // console.log('Menu:onDesktopMouseOver: borramos el intervalo') 747 clearInterval(menuCloseIntervalID); 748 menuCloseIntervalID = null; 749 } 750 751 $view.find('#main-bar > ul > li').removeClass('hover'); 752 $(this).addClass('hover'); 753 } 754 755 /** 756 * onDesktopMouseLeave 757 * @param {Event} e 758 * @return {null} 759 */ 760 function onDesktopMouseLeave(e) { 761 if (e) { e.preventDefault(); } 762 // console.log('Menu::onDesktopMouseLeave'); 763 764 if (menuCloseIntervalID) { 765 clearInterval(menuCloseIntervalID); 766 menuCloseIntervalID = null; 767 } 768 menuCloseIntervalID = setInterval(onIntervalTimer, 3000); 769 } 770 771 function onIntervalTimer() { 772 // console.log('Menu::onIntervalTimer'); 773 $view.find('#main-bar > ul > li').removeClass('hover'); 774 if (menuCloseIntervalID) { 775 clearInterval(menuCloseIntervalID); 776 menuCloseIntervalID = null; 777 } 778 } 779 780 function touchMove(e) { 781 // e.preventDefault(); 782 // e.stopPropagation(); 783 } 784 785 function attachEvents () { 786 instance.offMobileEvents(); 787 instance.offDesktopEvents(); 788 789 if ($(window).width() >= 1024) { 790 $view.removeClass('open').removeAttr('style'); 791 $(window).scroll(onDesktopScroll); 792 $view.find('.icon-search a').on('click', onDesktopShowSearchForm); 793 $view.find('.icon-language a').on('click', onDesktopShowLanguages); 794 $view.find('#main-bar > ul > li').on('mouseover', onDesktopMouseOver); 795 $view.find('#main-bar').on('mouseleave', onDesktopMouseLeave); 796 } 797 else { 798 $view.find('#btn-toggle').on('touchmove', touchMove).on('touchstart', onMobileMenuToggle); 799 $view.find('.submenus').on('touchmove', touchMove).on('touchend', onMobileShowMenus); 800 $view.find('.icon-search a').on('touchmove', touchMove).on('touchend', onMobileShowSearchForm); 801 $view.find('.icon-language a').on('touchmove', touchMove).on('touchend', onMobileShowLanguages); 802 // $(window).scroll(onMobileResize); 803 } 804 } 805 806 function offDesktopEvents () { 807 $(window).off('scroll', onDesktopScroll); 808 $view.find('.icon-search a').off('click', onDesktopShowSearchForm); 809 $view.find('.icon-language a').off('click', onDesktopShowLanguages); 810 $view.find('#main-bar > ul > li').off('mouseover', onDesktopMouseOver); 811 $view.find('#main-bar').off('mouseleave', onDesktopMouseLeave); 812 } 813 814 function offMobileEvents () { 815 $view.find('#btn-toggle').off('touchmove', touchMove).off('touchstart', onMobileMenuToggle); 816 $view.find('.submenus').off('touchmove', touchMove).off('touchend', onMobileShowMenus); 817 $view.find('.icon-search a').off('touchmove', touchMove).off('touchend', onMobileShowSearchForm); 818 $view.find('.icon-language a').off('touchmove', touchMove).off('touchend', onMobileShowLanguages); 819 // $(window).off('scroll', onMobileResize); 820 } 821 822 var instance = {}; 823 instance.offMobileEvents = offMobileEvents; 824 instance.offDesktopEvents = offDesktopEvents; 825 instance.attachEvents = attachEvents; 826 instance.init = function () { 827 this.attachEvents(); 828 $(window).resize(this.attachEvents); 829 }; 830 831 instance.init(); 832 833 return instance; 834 } 835 836 function onReady() { 837 instances.push(initInstance($('header#menu'))); 838 } 839 840 $(onReady); 841 }; 842 843 Menu(); 844 845})(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.