1/* Hay que añadir esta lÃnea para que no haya conflictos en el JS y se puedan utilizar las funciones en otros archivos fuente nuestros. 2Porque estaba dando un error de JS de que se llamaba a una función que no estaba declarada*/ 3var $ = jQuery.noConflict(); 4 5//FUNCTIONS 6 7/* FUNCIÃN QUE PERMITE IDENTIFICAR QUE HA CAMBIADO EL ALTO DE UN ELEMENTO, lo utilizamos para reiniciar el NiceScroll cuando cambia el alto del BODY*/ 8function onElementHeightChange(elm, callback) { 9 var lastHeight = elm.clientHeight, newHeight; 10 (function run() { 11 newHeight = elm.clientHeight; 12 if (lastHeight != newHeight) 13 callback(); 14 lastHeight = newHeight; 15 16 if (elm.onElementHeightChangeTimer) 17 clearTimeout(elm.onElementHeightChangeTimer); 18 19 elm.onElementHeightChangeTimer = setTimeout(run, 200); 20 })(); 21} 22 23 24 25function reinitSwiper(swiper) { /* No se está usando */ 26 setTimeout(function () { 27 swiper.update(); 28 }, 300); 29} 30function heightBox() { 31 if (jQuery('.js-sameHeight').length > 0) { 32 var position = 0; 33 jQuery('.js-sameHeight').each(function (index, elem) { 34 if (jQuery(this).parent('section').length > 0) { 35 position = jQuery(this).parent('section').index(); 36 sameHeight('main', '', position); 37 } 38 else { 39 var classParent = jQuery(this).parent().attr('class'); 40 //Ãsta parte se necesita cuando hay varios bloques con la misma clase y pueden o no ser hermanos. Hay que obtner su posición en el DOM 41 jQuery('.' + classParent).each(function (index2) { 42 if (jQuery('.js-sameHeight').length == 1) { //si sólo hay uno bloque con esta funcionalidad 43 sameHeight('.row', '.' + classParent, index2); 44 } 45 else { 46 if (index != index2) { //Para filtrar cuando hay más de un bloque con la funcionalidad no se repita todas la veces el bucle dentro del otro 47 sameHeight('.row', '.' + classParent, index2); 48 } 49 } 50 }); 51 } 52 }); 53 } 54} 55 56function sameHeight(grandParent, parent, position) { 57 58 if (jQuery(grandParent).children(parent).eq(position).find('.js-sameHeight .js-height').attr('style')) { 59 jQuery(grandParent).children(parent).eq(position).find('.js-sameHeight .js-height').removeAttr('style'); 60 } 61 62 if (navigator.userAgent.toLowerCase().indexOf("firefox") > -1) { 63 jQuery(grandParent).children(parent).eq(position).find('.js-sameHeight .js-height').each(function (index) { 64 if (index == 0) { 65 alto = jQuery(this).outerHeight(true); 66 } 67 else { 68 if (alto < jQuery(this).outerHeight(true)) { 69 alto = jQuery(this).outerHeight(true); 70 } 71 } 72 }); 73 } 74 else { 75 jQuery(grandParent).children(parent).eq(position).find('.js-sameHeight .js-height').each(function (index) { 76 if (index == 0) { 77 alto = jQuery(this).height(); 78 } 79 else { 80 if (alto < jQuery(this).height()) { 81 alto = jQuery(this).height(); 82 } 83 } 84 }); 85 } 86 jQuery(grandParent).children(parent).eq(position).find('.js-sameHeight .js-height').height(alto); 87} 88 89function grayscale(src) { 90 //console.log(src) 91 var canvas = document.createElement('canvas'); 92 var ctx = canvas.getContext('2d'); 93 var imgObj = new Image(); 94 imgObj.src = src; 95 canvas.width = imgObj.width; 96 canvas.height = imgObj.height; 97 ctx.drawImage(imgObj, 0, 0); 98 var imgPixels = ctx.getImageData(0, 0, canvas.width, canvas.height); 99 for (var y = 0; y < imgPixels.height; y++) { 100 for (var x = 0; x < imgPixels.width; x++) { 101 var i = (y * 4) * imgPixels.width + x * 4; 102 var avg = (imgPixels.data[i] + imgPixels.data[i + 1] + imgPixels.data[i + 2]) / 3; 103 imgPixels.data[i] = avg; 104 imgPixels.data[i + 1] = avg; 105 imgPixels.data[i + 2] = avg; 106 } 107 } 108 ctx.putImageData(imgPixels, 0, 0, 0, 0, imgPixels.width, imgPixels.height); 109 return canvas.toDataURL(); 110} 111// SLIDER GALLERY ESPECTÃCULO PRESENTACIÃN 112function loadSwiperGalleryShow() { 113 114 if ($('.swiper-gallery-show').length > 0) { 115 116 $('.swiper-gallery-show').each(function (index) { 117 var idGallery = $(this).attr('id'); 118 var indexGallery = $(this).attr('data-idgallery'); 119 var optionsGalleryShow = { 120 //pagination: '.swiper-pagination-gallery-' + index, 121 paginationClickable: true, 122 slidesPerView: 3, 123 spaceBetween: 30, 124 simulateTouch: false, 125 //speed: 1750, 126 //autoplayDisableOnInteraction: false, 127 //loop: true, 128 pagination: { 129 el: '.swiper-pagination-' + indexGallery, 130 type: 'bullets', 131 clickable: true, 132 bulletClass: 'swiper-pagination-bullet', 133 bulletActiveClass: 'swiper-pagination-bullet-active' 134 }, 135 136 navigation: { 137 nextEl: '.swiper-gallery-next-' + indexGallery, 138 prevEl: '.swiper-gallery-prev-' + indexGallery, 139 } 140 } 141 var swiperGalleryShow = new Swiper('#' + idGallery, optionsGalleryShow); 142 //console.log(idGallery); 143 }); 144 } 145} 146/* GALERIA MODAL */ 147function galleryinsideAccordion() { 148 $('.js-galleryModal').each(function (index) { 149 var idModal = $(this).attr('data-target'); 150 $(idModal).on('shown.bs.modal', function () { 151 // Galleria.loadTheme('/themes/custom/teatro_real/dist/js/galleria-1.5.7.min.js'); 152 //Hemos añadido el que está sin minificar, porque se han cambiado algunas cosas
153 Galleria.run(idModal + ' .gallery-img', { 154 imageCrop: true, 155 width: '100%', 156 thumbMargin: 10, 157 thumbFit: true, 158 swipe: 'enforced', 159 showCounter: false, 160 }); 161 $('html, body').css('overflow-y', 'hidden'); 162 }); 163 $(idModal).on('hidden.bs.modal', function () { 164 $('html, body').css('overflow-y', 'auto'); 165 }); 166 }); 167} 168/* Swiper de espectaculos que está dentro del doble acordeón de Abonos dentro de la tab */ 169function swiperInsideTabsAccordion() { 170 var swiperListShows = new Swiper('.swiper-list-shows', { 171 //pagination: '.swiper-pagination-title-description', 172 //paginationClickable: true, 173 slidesPerView: 3, 174 spaceBetween: 30, 175 simulateTouch: false, 176 allowTouchMove: false, 177 //speed: 1750, 178 //autoplayDisableOnInteraction: false, 179 //loop: true, 180 navigation: { 181 nextEl: '.swiper-button-next', 182 prevEl: '.swiper-button-prev', 183 }, 184 breakpoints: { 185 767: { 186 slidesPerView: 1 187 } 188 }, 189 on: { 190 resize: function () { 191 if (window.innerWidth >= 768) { 192 //Quitamos los estilos de cada item del slider y también del padre, swiper-wrapper 193 this.slides.css('width', ''); 194 this.slides.css('margin', ''); 195 this.wrapperEl.attributes.style.value = ''; 196 } 197 } 198 } 199 }); 200 201 var swiperCalendaryShows = new Swiper('.swiper-calendary-shows', { 202 //pagination: '.swiper-pagination-title-description', 203 //paginationClickable: true, 204 slidesPerView: 2, 205 spaceBetween: 7, 206 simulateTouch: false, 207 allowTouchMove: false, 208 //speed: 1750, 209 //autoplayDisableOnInteraction: false, 210 //loop: true, 211 navigation: { 212 nextEl: '.swiper-calendary-next', 213 prevEl: '.swiper-calendary-prev', 214 }, 215 breakpoints: { 216 993: { 217 slidesPerView: 2 218 }, 219 768: { 220 slidesPerView: 1 221 }, 222 480: { 223 slidesPerView: 1 224 } 225 }, 226 on: { 227 resize: function () { 228 if (window.innerWidth >= 1200) { 229 //Quitamos los estilos de cada item del slider y también del padre, swiper-wrapper 230 this.slides.css('width', ''); 231 this.slides.css('margin', ''); 232 this.wrapperEl.attributes.style.value = ''; 233 } 234 } 235 } 236 }); 237} 238 239jQuery(document).ready(function ($) { 240 241 if ($('.js-datepicker').length > 0){ 242 243 $('.js-datepicker .date').each(function () { 244 var idDate = $(this).attr('id'); 245 $('#'+idDate).datepicker({ 246 //buttonImage: '../../images/icons/calendar.png', 247 //buttonImageOnly: true, 248 buttonText: "", 249 showOn: 'both', 250 onClose: function (dateText, inst) { 251 $(this).parents('.js-datepicker').find('.year').val(dateText.split('/')[2]); 252 $(this).parents('.js-datepicker').find('.month').val(dateText.split('/')[0]); 253 $(this).parents('.js-datepicker').find('.day').val(dateText.split('/')[1]); 254 }, 255 beforeShow: function (input, inst) { 256 $('.ui-datepicker').appendTo($(this).parents('.js-datepicker')); 257 } 258 }).next(".ui-datepicker-trigger").addClass("icon-calendar"); 259 }); 260 } 261 262 263});jQuery(document).ready(function ($) { 264 265 // 1.- Mobile menu open 266 if ($('.js-toggleMenu').length > 0) { 267 if($(window).width() < 1200){ 268 $('.header').on('click','.js-toggleMenu', function() { 269 //console.log(!$(this).hasClass('js-dropLang')); 270 //console.log('click toggle'); 271 if (!$('.main-menu').hasClass('display-menu')) { 272 $(this).addClass('open'); 273 $('.main-menu').addClass('display-menu'); 274 $('.options-header').addClass('display-menu'); 275 $('.header').addClass('open'); 276 277 } else { 278 $(this).removeClass('open'); 279 $('.main-menu').removeClass('display-menu'); 280 $('.options-header').removeClass('display-menu'); 281 $('.main-menu ul').removeClass('open-menu'); 282 $('.main-menu > ul').find('.open').removeClass('open'); 283 $('.main-menu > ul').find('.open-submenu').removeClass('open-submenu'); 284 $('.main-menu > ul').find('.open-submenu-inner').removeClass('open-submenu-inner'); 285 286 } 287 }); 288 } 289 } 290 // END Mobile menu open 291 292 /* 2.- PARA GENERAR LAS COLUMNAS SEGÃN LOS BREAK AÃADIDOS */ 293 if($(window).width() >= 1200){ 294 $('.main-menu .dropdown-menu li').each(function(){ 295 296 if($(this).parents('.col-menu').length == 0){ 297 $(this).nextUntil('.break').addBack().wrapAll('<div class="col-menu"></div>'); 298 } 299 else{ 300 if($(this).parents('.col-inner').length == 0 && $(this).hasClass('break-inner')){ 301 $(this).nextUntil('.break-inner').addBack().wrapAll('<div class="col-inner"></div>'); 302 } 303 } 304 }); 305 } 306 307 if($('.main-menu').length > 0 ){ 308 309 // Remueve data-toggle si el primer nivel tiene link 310 if($('.main-menu ul li a.first_level').each( function (index) { 311 if($( this ).attr('href').length > 0) { 312 $( this ).removeAttr('data-toggle'); 313 } 314 })); 315 316 317 /* Quitar data-toggle de los tÃtulos en desktop */ 318 if($(window).width() > 1200) { 319 $('.main-menu .dropdown-menu .title-section .link-section').removeAttr('data-toggle'); 320 } 321 /* 3.- Para cerrar */ 322 $('body').on('click', '.block-page-background, .outstanding-play, .js-close-menu, .logo, .js-dropLang, .main-menu', function(event) { 323 324 325 if($(window).width() < 1200){ 326 //console.log('click 1'); 327 328 //console.log("4.- "+$(this).attr('class')); 329 if($('.header').hasClass('open') && !$(this).hasClass('js-dropLang') && !$(this).hasClass('main-menu') && !$(this).hasClass('logo')) { 330 //console.log('click 1.1'); 331 event.preventDefault(); 332 event.stopPropagation(); 333 $('.header').removeClass('open'); 334 $('.header .js-toggleMenu').removeClass('open'); 335 $('.header .logo').attr('style',''); 336 $('.main-menu ul').find('.open').removeClass('open'); 337 $('.main-menu').removeClass('display-menu'); 338 $('.options-header').removeClass('display-menu'); 339 $('.main-menu ul').removeClass('open-menu'); 340 } 341 } 342 else{ 343 //console.log('close 2'); 344 if($('.header').hasClass('open')){ 345 //console.log('close 3'); 346 $('.header').removeClass('open'); 347 $('.header .js-toggleMenu').removeClass('open'); 348 $('.header .logo').attr('style',''); 349 $('.main-menu ul').find('.open').removeClass('open'); 350 } 351 } 352 }); 353 354 /* 4.- Esto se necesita para que en móvil no se cierre el submenú al pinchar fuera pero dentro del header*/ 355 $('.header').on('click', '.main-menu, .options-header, .wrap-logo', function(event) { 356 //event.preventDefault(); 357 //console.log('click 2'); 358 //console.log($(this).attr('class')); 359 if($(window).width() < 1200){ 360 if($('.header').hasClass('open') && !$(this).hasClass('link-search')){ 361 event.stopPropagation(); 362 //console.log('NO click search') 363 } 364 else{ 365 //console.log('click search') 366 } 367 } 368 369 370 }); 371 /* 5.- Esto se necesita para que en móvil se abra la modal */ 372 if($(window).width() < 1200){ 373 $('.options-header').on('click', '.link-search', function(event){ 374 var idModal = $(this).attr('data-target'); 375 $(idModal).modal('show'); 376 }); 377 } 378 379 380 /* 6.- CLICK EN EL DROPDOWN */ 381 $('.main-menu ul [data-toggle=dropdown]').on('click', function(event) { 382 event.preventDefault(); 383 event.stopPropagation(); 384 if($(window).width() < 1200){ /* VERSIÃN RESPONSIVE*/ 385 if(!$('.main-menu > ul').hasClass('open-menu')){ 386 $('.main-menu > ul').addClass('open-menu'); 387 } 388 else{ 389 if($(this).parents('li').hasClass('open') && $(this).parent('li').hasClass('title-section') ) { //con este condicional no pasa nada si le das al titulo -- para el primer nievel 390 if($(this).parents('li').hasClass('open-submenu')) { 391 event.preventDefault(); 392 event.stopPropagation(); 393 394 } 395 else{ 396 $(this).parents('li.open').addClass('open-submenu'); 397 $(this).parents('li.title-section').addClass('open'); 398 } 399 400 } 401 else{ 402 if($(this).parent('li').hasClass('link-submenu')){ 403 //console.log('tercer nivel'); 404 $(this).parents('li.title-section').addClass('open-submenu-inner'); 405 $(this).parents('li.link-submenu').addClass('open'); 406 } 407 } 408 } 409 } 410 else{ /* VERSIÃN DESKTOP */ 411 if(!$(this).parent('li').hasClass('link-submenu') && !$(this).parents('ul').hasClass('dropdown-menu') ){ 412 //Reseteamos los valores 413 $('.header .logo').removeClass('long'); 414 $('.header .logo').attr('style', ''); 415 $('.main-menu .dropdown-menu').attr('style', ''); 416 //Comparamos alturas, la del menú (dropdown o la del logo, y la que sea mayor es la que añadimos al otro elemento) 417 //ar heightWindow = $(window).height(); 418 //var heightHeader = $('.header').outerHeight(); //Alto barra del menú superior 419 420 //var heightLogo = $('.header .logo').outerHeight();
420 //alto Logo 421 var heightnav = $('.header .main-menu').outerHeight(); 422 // var heightSubmenu = $(this).siblings('.dropdown-menu').outerHeight(); //Alto menú desplegado 423 424 425 var heightSubmenu = $(this).siblings('.dropdown-menu').outerHeight(); 426 427 // if((heightLogo-heightHeader) > heightSubmenu){ //Comprobamos si la altura del logo sin el alto del header, es mayor que el del dropdown 428 // $(this).siblings('.dropdown-menu').outerHeight(heightLogo-heightHeader); 429 // } 430 // else{ 431 // $('.header .logo').addClass('long').outerHeight(heightSubmenu+heightHeader); 432 // } 433 $('.header .logo').addClass('long').outerHeight(heightSubmenu + heightnav); 434 } 435 else{ 436 event.preventDefault(); 437 event.stopPropagation(); 438 } 439 440 } 441 442 /* 7.- QUà HACE ESTO?????----------------->>>>>>>>>>>>>>> ANALIZAR */ 443 //Esto es cuando has clicado en el tÃtulo del primer nivel, como programación: .main-menu > ul >li > a.layout-inner-three-cols.link-section.layout-inner-four-cols 444 if($(this).hasClass('link-section') && !$(this).parents('ul').hasClass('dropdown-menu')){ 445 446 if(!$(this).parent('li').hasClass('open')){ /* Si su padre, li, no tiene la clase open quiere decir que no se le ha clicado y se le añade*/ 447 //console.log("7b.- "+$(this).parent().attr('class')); 448 if($(window).width() >= 1200){ 449 $(this).parent().siblings().removeClass('open'); 450 } 451 $(this).parent().addClass('open'); 452 } 453 else{ /*serÃa darle otra vez, pero ya se ha abierto, asà que se desactiva para que no haga nada, porque ya es sólo tÃtulo, no enlace*/ 454 event.preventDefault();//console.log("7.- "+$(this).attr('class')) 455 } 456 457 } 458 459 460 /* 8.- QUà HACE ESTO?????----------------->>>>>>>>>>>>>>> ANALIZAR creo que esto es para descktop */ 461 if($(window).width() >= 1200){ /* VERSIÃN DESKTOP*/ 462 if($('.main-menu').find('.open').length > 0){ 463 $('.header').addClass('open'); 464 $(this).siblings('.dropdown-menu').css('height', 'auto'); 465 var heightnav = $('.header .main-menu').outerHeight(); 466 467 //console.log(heightnav); 468 469 var heightSubmenu = $(this).siblings('.dropdown-menu').outerHeight(); 470 //console.log(heightSubmenu); 471 472 $('.header .logo').addClass('long').outerHeight(heightSubmenu + heightnav); 473 } 474 else{ 475 476 $('.header').removeClass('open'); 477 $('.header .logo').removeClass('long'); 478 $('.header .logo').attr('style', ''); 479 $(this).siblings('.dropdown-menu').attr('style', ''); 480 } 481 } 482 }); 483 $(window).on('resize', function () { 484 if ($(window).width() >= 1200) { 485 if( $('header').hasClass('open') ){ 486 var heightnav = $('.header .main-menu').outerHeight(); 487 var heightOpen = $('li.open ul.dropdown-menu').outerHeight(); 488 $('.header .logo').addClass('long').outerHeight(heightOpen + heightnav); 489 } 490 } 491 }); 492 /* 9.- DESABILITAR EL DROPDOWN EN RESPONSIVE*/ 493 $('body').on('click', '.dropdown-menu', function(event) { 494 if($(window).width() < 1200){ 495 //console.log('click 4'); 496 event.preventDefault(); 497 event.stopPropagation(); 498 } 499 }); 500 /* END DESABILITAR EL DROPDOWN EN RESPONSIVE */ 501 502 /* 10.- CLICK EN FLECHA PARA VOLVER A ATRÃS */ 503 if($('.main-menu .js-back').length > 0){ 504 $('.main-menu ').on('click', '.js-back', function(event) { 505 //console.log('click 5'); 506 event.preventDefault(); 507 event.stopPropagation(); 508 //console.log('click 3'); 509 if($(this).parent('li').hasClass('open') && $('.main-menu').find('.open-submenu').length ==0){ //NIVEL 1 510 $(this).parent('li').removeClass('open'); 511 $(this).parents('ul').removeClass('open-menu'); 512 } 513 else{ 514 515 if($(this).parent('li').hasClass('title-section')){ //NIVEL 2 516 $(this).parent('li.title-section').removeClass('open-submenu open'); 517 $(this).parents('li.open').removeClass('open-submenu'); 518 } 519 else{ 520 if($(this).parent('li').hasClass('link-submenu')){ //NIVEL 3 521 $(this).parent('li.link-submenu').removeClass('open-submenu open'); 522 $(this).parents('li.title-section').removeClass('open-submenu-inner'); 523 } 524 } 525 } 526 }); 527 } 528 /* END CLICK EN FLECHA */ 529 530 } 531});jQuery(document).ready(function ($) { 532 533 //Slider DESTACADOS 534 var swiperFeatured = new Swiper('.swiper-featured', { 535 //init: false, 536 navigation: { 537 nextEl: '.swiper-button-next', 538 prevEl: '.swiper-button-prev', 539 }, 540 slidesPerView: 'auto', 541 //loop: true, 542 //slidesOffsetBefore:34, 543 //loopedSlides: 3, 544 //slidesPerColumn: 2, 545 //slidesPerColumnFill: 'group', 546 spaceBetween: 54, 547 simulateTouch: false, 548 allowTouchMove: false, 549 breakpoints: { 550 1199: { 551 slidesPerView: 3, 552 spaceBetween: 48, 553 }, 554 983: { 555 slidesPerView: 2, 556 spaceBetween: 30, 557 }, 558 767: { 559 slidesPerView: 1, 560 }, 561 }, 562 on: { 563 resize: function () { 564 if (window.innerWidth >= 983) { 565 this.slides.css('width', ''); 566 } 567 } 568 }, 569 }); 570 571 572 573 var swiper2 = new Swiper('.swiper-inner', { 574 navigation: { 575 nextEl: '.swiper-next', 576 prevEl: '.swiper-prev', 577 }, 578 spaceBetween: 0, 579 //nested: true 580 }); 581});jQuery(document).ready(function ($) { 582 583 var swiperHome; 584 var slidesData = []; 585 586 function buildSlidesData() { 587 slidesData = []; 588 $('.swiper-home .swiper-slide').not('.swiper-slide-duplicate').each(function () { 589 var $slide = $(this); 590 var src = $slide.find('img').attr('src') || ''; 591 var videoSrc = ''; 592 593 if (!src) { 594 var $vid = $slide.find('video.video-slider'); 595 if ($vid.length) { 596 videoSrc = $vid.attr('src') || ''; 597 } 598 } 599 600 var dates = $slide.find('h5').text().trim(); 601 slidesData.push({ 602 name: $slide.find('h2').text().trim(), 603 dates: dates.length > 5 ? dates.slice(-5) : dates, 604 srcImg: src, 605 videoSrc: videoSrc 606 }); 607 }); 608 } 609 610 function setStripMedia($strip, d) { 611 var $container = $strip.find('.wrap-img-filter'); 612 var $existing = $container.find('img, video'); 613 614 if (d.videoSrc) { 615 if ($existing.is('video')) { 616 if ($existing.attr('src') !== d.videoSrc) $existing.attr('src', d.videoSrc); 617 } else { 618 $existing.remove(); 619 $container.append( 620 $('<video>').attr({ src: d.videoSrc, autoplay: '', loop: '', muted: '', playsinline: '' }) 621 ); 622 } 623 } else if (d.srcImg) { 624 if ($existing.is('img')) { 625 if ($existing.attr('src') !== d.srcImg) $existing.attr('src', d.srcImg); 626 } else { 627 $existing.remove(); 628 $container.append($('<img>').attr({ src: d.srcImg, alt: d.name })); 629 } 630 } 631 } 632 633 function updateStrips(realIndex) { 634 var $strips = $('.wrap-filters .fixed-play'); 635 if ($strips.length < 2 || !slidesData.length) return; 636 var total = slidesData.length; 637 638 var indices = [ 639 (realIndex + 1) % total, 640 ((realIndex - 1) % total + total) % total 641 ]; 642
643 indices.forEach(function (idx, i) { 644 var d = slidesData[idx]; 645 $strips.eq(i).attr('data-slide', idx); 646 $strips.eq(i).find('h4').text(d.name); 647 $strips.eq(i).find('span').text(d.dates); 648 setStripMedia($strips.eq(i), d); 649 }); 650 } 651 652 function startSliderHome() { 653 if (!$('.swiper-home').length) return; 654 655 var opts = { 656 navigation: { nextEl: '.swiper-home-next', prevEl: '.swiper-home-prev' }, 657 slidesPerView: 1, 658 spaceBetween: 0, 659 simulateTouch: false, 660 loop: true, 661 loopAdditionalSlides: 4, 662 on: { 663 slideChange: function () { updateStrips(this.realIndex); } 664 } 665 }; 666 if ($('.swiper-home .item').length > 1) { 667 opts.autoplay = { delay: 6000 }; 668 } 669 swiperHome = new Swiper('.swiper-home', opts); 670 } 671 672 function bindStripNavigation() { 673 var $strips = $('.wrap-filters .fixed-play'); 674 if (!$strips.length) return; 675 676 // Build slide data array once from the real (non-cloned) slides 677 buildSlidesData(); 678 679 // Replace Drupal <picture> elements with plain <img> in strips; 680 // setStripMedia will handle video slides by swapping to <video> 681 $strips.each(function () { 682 var $pic = $(this).find('picture'); 683 if ($pic.length) { 684 var src = $pic.find('img').attr('src') || ''; 685 var alt = $pic.find('img').attr('alt') || ''; 686 $pic.replaceWith($('<img>').attr({ src: src, alt: alt })); 687 } else { 688 $(this).find('source').remove(); 689 $(this).find('img').removeClass('img-responsive'); 690 } 691 }); 692 693 // Set initial strip content from the data array 694 updateStrips(swiperHome ? swiperHome.realIndex : 0); 695 696 $strips.eq(0).on('click', function (e) { 697 e.preventDefault(); 698 if (swiperHome) swiperHome.slideNext(600); 699 }); 700 $strips.eq(1).on('click', function (e) { 701 e.preventDefault(); 702 if (swiperHome) swiperHome.slidePrev(600); 703 }); 704 } 705 706 setTimeout(function () { 707 startSliderHome(); 708 bindStripNavigation(); 709 }, 500); 710 711}); 712 713 714jQuery(document).ready(function ($) { 715 loadSwiperGalleryShow(); 716 717 $('.accordions .wrap-accordion').each(function () { 718 var idAccordion = $(this).find('.collapse').attr('id'); 719 720 $('#' + idAccordion).on('shown.bs.collapse', function () { 721 //var idTab = $(this).find('.tabs').children('li').children('a').attr('href'); 722 /* Acordeones, cambian el alto del DOM, recalcularlo con el nicescroll */ 723 724 loadSwiperGalleryShow(); 725 726 if ($(document).width() >= 1200) { //desactivados los swiper 727 $("html, body").getNiceScroll().resize(); 728 } 729 else { // se activan para responsive 730 if ($(document).width() < 768) { 731 swiperInsideTabsAccordion(); 732 } 733 734 } 735 $('#' + idAccordion).on('shown.bs.tab', 'a[data-toggle="tab"]', function () { /* Esto es para las tabs, que se tienen que activar cuando le das al calendario*/ 736 var idTab = $(this).attr('href'); 737 /* SI es la tabs de Espectaculo que no lo recalcule si es mayor de 768, solo en responsive */ 738 if (idTab.substr(idTab.length - 1) != 1) { 739 swiperInsideTabsAccordion(); //Aquà entra cuando es 2, es decir la tab de calendario 740 } 741 else { 742 if ($(document).width() < 768) { /* activa el swiper si es menos de 768, responsive, siempre que le des a la tab de espectaculo, la tab 1 */ 743 swiperInsideTabsAccordion(); 744 } 745 } 746 }); 747 }); 748 }); 749 750 751 752 //Inicializamos el swiper solo para responsive 753 if ($(window).width() < 768 && $('.swiper-list-shows').length > 0) { 754 swiperInsideTabsAccordion(); 755 } 756 757 if ($(window).width() < 1200 && $('.swiper-calendary-shows').length > 0) { 758 swiperInsideTabsAccordion(); 759 } 760 //inicializamos de nuevo cuando se hace resize() 761 $(window).resize(function () { 762 if ($(window).width() < 768 && $('.swiper-list-shows').length > 0) { 763 swiperInsideTabsAccordion(); 764 } 765 766 if ($(window).width() < 1200 && $('.swiper-calendary-shows').length > 0) { 767 swiperInsideTabsAccordion(); 768 } 769 }); 770 771}); 772jQuery(document).ready(function ($) { 773 if ($('.page-menu').length > 0) { 774 if ($(window).width() < 992){
775 $('.page-menu__list .title-dropdown').find('p').text($('.page-menu__list').find('.active').children('a').text()); 776 $('.page-menu__list a[data-toggle="tab"]').on('shown.bs.tab', function (e) { 777 var text = $(this).text(); 778 $('.page-menu__list .title-dropdown').find('p').text(text); 779 $('.js-pageMenu').trigger('click'); 780 }); 781 } 782 } 783});jQuery(document).ready(function ($) { 784 /*window.addEventListener("touchstart", { passive: true }); 785 Nice scroll, solo para 1200-1499px, que hay un overflow por el diseño, debido a que se no se contempló el scroll del navegador*/ 786 if ($(document).width() >= 1200) { 787 if($('iframe').length > 0 ){ 788 //console.log('hay iframe'); 789 $('html').addClass('have-iframe'); 790 } 791 else{ 792 //console.log('no hay iframe'); 793 $("html, body").niceScroll({ zindex: 99999, cursorborder: "1px solid #000", horizrailenabled: false }); 794 } 795 796 797 /* $('.accordionbutton').on('click', 798 function(e){ 799 setTimeout(function(){ $('html, body').getNiceScroll().resize()}, 600) 800 } 801 ); */ 802 } 803 if ($('.search-api-autocomplete-search').length > 0) { 804 $('.search-api-autocomplete-search').niceScroll({ zindex: '99999999', cursorborder: "1px solid #000", horizrailenabled: false }); 805 } 806 807 setTimeout(heightBox, 1500); 808 /*Llamada a la función para comprobar cuándo cambia el alto del BODY por añadir elementos dinámicamente y asà poder reiniciar el NiceScroll*/ 809 onElementHeightChange(document.body, function () { 810 if (!$('iframe').length > 0) { 811 $("html, body").getNiceScroll().resize(); 812 } 813 }); 814 815 /* CÃDIGO NECESARIO PARA ELIMINAR PUBLICIDAD DEL PLUGIN JUICER, DEL MODULO DE RRSS */ 816 var checkExist = setInterval(function () { 817 if ($('.juicer-feed h1').length >0) { 818 $('.juicer-feed h1').remove(); 819 $('.juicer-feed .juicer-ad').remove(); 820 clearInterval(checkExist); 821 } 822 }, 100); 823 $(window).on('resize', function () { 824 825 //console.log($(window).height); 826 var checkExist = setInterval(function () { 827 if ($('.juicer-feed .juicer-ad').length > 0) { 828 $('.juicer-feed .juicer-ad').remove(); 829 clearInterval(checkExist); 830 } 831 }, 100); 832 }); 833 834// Ancla para scroll down 835 if ($('.js-top').length > 0) { 836 if($('.pshow').find(".js-top").length){ 837 $('.js-top').on('click', function (event) { 838 event.preventDefault(); 839 // misfunciones 840 var moveToShows = $(".functions-show").offset().top 841 $('html, body').animate({ scrollTop: moveToShows }, 2000, 'easeInOutExpo'); 842 }); 843 } 844 else { 845 $('.js-top').on('click', function (event) { 846 event.preventDefault(); 847 var moveTo = $(".outstanding-play").height(); 848 $('html, body').animate({ scrollTop: moveTo }, 2000, 'easeInOutExpo'); 849 }); 850 } 851} 852 853 854 $(window).on('load', function () { 855 856 if ($('.js-grayscale').length > 0) { 857 var srcImg = $('.js-grayscale').find('img').attr('src'); 858 $('.js-grayscale').find('img.img-one').clone().insertBefore('.img-one').removeClass('img-one').addClass('img-copy'); 859 var newSrcImg = grayscale(srcImg); 860 //console.log(srcImg) 861 $('.js-grayscale').find('img.img-copy').attr('src', srcImg); 862 $('.js-grayscale').find('img.img-one').css({ "position": "absolute", "top": "0", "z-index": "998", "opacity": "0" }).attr('src', newSrcImg); 863 864 /*$('.js-grayscale').find('img.img-one').on({ 865 mouseenter: function () { 866 console.log('mouseenter') 867 //stuff to do on mouse enter 868 $(this).css({"opacity":"0","z-index":"0" }); 869 $(this).siblings('img-img-two').css({"opacity":"1"}); 870 }, 871 mouseleave: function () { 872 //stuff to do on mouse leave 873 console.log('mouseleave') 874 $(this).siblings('img-img-two').css({"opacity":"0"}); 875 } 876 }); 877 $('.js-grayscale').find('img.img-one').on('mouseover', function(event){ 878 event.preventDefault(); 879 880 console.log('mouseover') 881 $(this).css({"opacity":"0","z-index":"0" }); 882 $(this).siblings('img-img-two').css({"opacity":"1"}); 883 });*/ 884 } 885 886 /* Acordeón en calendario cambiar padre */ 887 if ($('.calendar-accordion').length > 0) { 888 889 window.idToggle = "accordion-month-1"; //inicializarlo con el primero, para que siempre funcione 890 $(".block-calendary").on('hide.bs.collapse', function () { 891 window.idToggle = $(this).attr('id'); 892 893 }); 894 $(".block-calendary").on('shown.bs.collapse', function () {//tiene que ser shown porque si no aún no se muestra en el DOM y no puedo obtener ningún valor. 895 if ($(document).width() >= 1200) { 896 //cojo el index, número del elemento, el 1, 2, 3... Para luego multiplicarlo por el alto completo de cada header del tÃtulo del mes. Y le sumo 220, que es 60 del header y 160 de la zona del page-social-icons y el dropdown 897 numElement = $(this).parents('.panel').index(); 898 899 var outerHeightItem = $('#' + window.idToggle).parent('.panel').children('.header__menu-calendary').outerHeight(); 900 901 totalHeight = 220 + (outerHeightItem * numElement); 902 903 $('html, body').animate({ scrollTop: totalHeight }, 0, 'linear'); //animación muy rápida para que no se note mucho 904 } 905 /* Al cambiar el alto del DOM que se recalcule el niceScroll */ 906 if (!$('iframe').length > 0) { 907 $("html, body").getNiceScroll().resize(); 908 } 909 }); 910 } 911 912 913 914 //Go to top 915 916 917 918 //ISOTOPE 919 if ($('.isotope').length > 0) { 920 var $container = $('.isotope').isotope({ 921 itemSelector: '.js-element-card', 922 layoutMode: 'masonry', 923 masonry: { 924 horizontalOrder: true, 925 fitWidth: true 926 } 927 }); 928 $('.filters').on('click', 'a', function () { 929 //Para marcar el filtro activo 930 //console.log($(this).parent('li').hasClass('active')) 931 if (!$(this).parent('li').hasClass('active')) { 932 $(this).parents('.filters').children('li').removeClass('active'); 933 $(this).parent('li').addClass('active'); 934 //Para actualizar el isotope y que filtre
935 var filterValue = $(this).attr('data-filter'); 936 $container.isotope({ 937 938 itemSelector: '.js-element-card', 939 layoutMode: 'masonry', 940 masonry: { 941 horizontalOrder: true, 942 fitWidth: true 943 }, 944 filter: filterValue 945 }); 946 } 947 948 }); 949 950 951 } 952 }); 953 954 955 956 957 //Para los select de los filtros 958 if ($('.selectpicker').length > 0) { 959 $('.selectpicker').selectpicker({ 960 style: 'border-no', 961 iconBase: 'teatro_real', 962 tickIcon: 'icon-arrow_down' 963 }); 964 } 965 966 //Slider de PROGRAMACIÃN 967 $(".swiper-programming").each(function (elem, index) { 968 var numItem = $(this).find(".swiper-slide").length;// console.log(numItem); 969 if ($(this).find(".swiper-slide").length >= 5) { 970 options = { 971 slidesPerView: 5, 972 centeredSlides: true, 973 slideToClickedSlide: true, 974 preventClicksPropagation: false, 975 initialSlide: 2, 976 spaceBetween: 35, 977 grabCursor: true, 978 autoplay: 2000, 979 speed: 1750, 980 loop: true, 981 loopedSlides: 50, 982 navigation: { 983 nextEl: '.swiper-program-next', 984 prevEl: '.swiper-program-prev', 985 }, 986 breakpoints: { 987 1599: { 988 slidesPerView: 5, 989 spaceBetween: 35 990 }, 991 1199: { 992 slidesPerView: 3, 993 spaceBetween: 48 994 }, 995 983: { 996 slidesPerView: 3, 997 spaceBetween: 48 998 }, 999 767: { 1000 slidesPerView: 1, 1001 spaceBetween: 30, 1002 initialSlide: 0 1003 }, 1004 } 1005 } 1006 } else { 1007 $(this).children(".swiper-wrapper").addClass('justify-swiper'); 1008 options = { 1009 loop: false, 1010 autoplay: false, 1011 slidesPerView: numItem, 1012 centeredSlides: false, 1013 slideToClickedSlide: true, 1014 preventClicksPropagation: false, 1015 allowTouchMove: false, 1016 //initialSlide: 1, 1017 spaceBetween: 35, 1018 //grabCursor: true, 1019 //loopedSlides: 50, 1020 navigation: { 1021 nextEl: '.swiper-program-next', 1022 prevEl: '.swiper-program-prev', 1023 }, 1024 breakpoints: { 1025 1599: { 1026 spaceBetween: 35 1027 }, 1028 1199: { 1029 spaceBetween: 48 1030 }, 1031 983: { 1032 spaceBetween: 48 1033 }, 1034 767: { 1035 slidesPerView: 1, 1036 spaceBetween: 30 1037 }, 1038 } 1039 } 1040 } 1041 var swiperProgramming = new Swiper(this, options); 1042 1043 }); 1044 1045 var swiperTitleDes = new Swiper('.swiper-title-description', { 1046 //pagination: '.swiper-pagination-title-description', 1047 //paginationClickable: true, 1048 slidesPerView: 4, 1049 spaceBetween: 53, 1050 simulateTouch: false, 1051 //speed: 1750, 1052 //autoplayDisableOnInteraction: false, 1053 //loop: true, 1054 navigation: { 1055 nextEl: '.swiper-button-next', 1056 prevEl: '.swiper-button-prev', 1057 }, 1058 breakpoints: { 1059 767: { 1060 slidesPerView: 1 1061 }, 1062 1063 983: { 1064 slidesPerView: 2, 1065 spaceBetween: 48 1066 }, 1067 1068 1199: { 1069 slidesPerView: 3, 1070 spaceBetween: 48, 1071 } 1072 } 1073 }); 1074 1075 1076 var swiperThumbTitleDes = new Swiper('.swiper-thumbnail-title-description', { 1077 //pagination: '.swiper-pagination-thumbnail-title-description', 1078 //paginationClickable: true, 1079 slidesPerView: 4, 1080 spaceBetween: 48, 1081 simulateTouch: false, 1082 //speed: 1750, 1083 //autoplayDisableOnInteraction: false, 1084 //loop: true, 1085 navigation: { 1086 nextEl: '.swiper-thumb-next', 1087 prevEl: '.swiper-thumb-prev', 1088 }, 1089 breakpoints: { 1090 1091 1199: { 1092 slidesPerView: 3, 1093 spaceBetween: 64 1094 }, 1095 991: { 1096 slidesPerView: 3, 1097 spaceBetween: 30 1098 }, 1099 767: { 1100 slidesPerView: 1 1101 } 1102 1103 } 1104 }); 1105 1106 // SLIDER VENTAJAS ABONOS PRESENTACIÃN 1107 1108 var swiperAdvantages = new Swiper('.swiper-advantages', { 1109 //pagination: '.swiper-pagination-title-description', 1110 //paginationClickable: true, 1111 slidesPerView: 4, 1112 //spaceBetween: 30, 1113 simulateTouch: false, 1114 //speed: 1750, 1115 //autoplayDisableOnInteraction: false, 1116 //loop: true, 1117 navigation: { 1118 nextEl: '.swiper-button-next', 1119 prevEl: '.swiper-button-prev', 1120 }, 1121 breakpoints: { 1122 767: { 1123 slidesPerView: 1 1124 } 1125 } 1126 1127 }); 1128 1129 1130 //Slider de PACKAGES-OFERTS ESPECTÃCULO PRESENTACIÃN 1131 var swiperOferts = new Swiper('.swiper-oferts', { 1132 spaceBetween: 70, 1133 simulateTouch: false, 1134 slidesPerView: 'auto', 1135 navigation: { 1136 nextEl: '.swiper-oferts-next', 1137 prevEl: '.swiper-oferts-prev', 1138 }, 1139 on: { 1140 resize: function () { 1141 if (window.innerWidth >= 768) { 1142 this.slides.css('width', ''); 1143 } 1144 } 1145 }, 1146 breakpoints: { 1147 1148 1399: { 1149 spaceBetween: 40 1150 }, 1151 1152 1199: { 1153 spaceBetween: 27 1154 }, 1155 1156 991: { 1157 spaceBetween: 30 1158 }, 1159 767: { 1160 slidesPerView: 1 1161 } 1162 } 1163 }); 1164 1165 1166 1167 1168 1169 1170 // Language menu 1171 1172 $('.header').on('click', '.options-header--left .js-dropLang', function (e) { 1173 e.preventDefault(); 1174 $(this).siblings('.options-header--submenu').toggleClass('display-lang'); 1175 }); 1176 1177 if ($('.page-menu').length > 0) { 1178 /* Estas lÃneas sirven para las tabs en responsive se puedan desplegar las opciones del "select" */ 1179 $('.page-menu').on('click', '.js-pageMenu', function () { 1180 if (!$('.page-menu__list--item').hasClass('display-pageMenu')) { 1181 $($('.page-menu__list--item')).addClass('display-pageMenu'); 1182 1183 } else { 1184 $($('.page-menu__list--item')).removeClass('display-pageMenu'); 1185 } 1186 }); 1187 } 1188 // Cerrar aviso 1189 1190 if ($('.advice').length > 0) { 1191 $('.js-closeAdvice').on('click', function (event) { 1192 $('.advice').slideUp(); 1193 }); 1194 } 1195 1196 // Fin cerrar aviso 1197 1198 if ($('.js-galleryModal').length > 0) { 1199 $('.js-galleryModal').each(function (index) { 1200 var idModal = $(this).attr('data-target'); 1201 $(idModal).on('shown.bs.modal', function () { 1202 // Galleria.loadTheme('/themes/custom/teatro_real/dist/js/galleria-1.5.7.min.js'); 1203 //Hemos añadido el que está sin minificar, porque se han cambiado algunas cosas
1204 Galleria.run(idModal + ' .gallery-img', { 1205 imageCrop: true, 1206 width: '100%', 1207 thumbMargin: 10, 1208 thumbFit: true, 1209 swipe: 'enforced', 1210 showCounter: false, 1211 }); 1212 $('html, body').css('overflow-y', 'hidden'); 1213 1214 }); 1215 $(idModal).on('hidden.bs.modal', function () { 1216 $('html, body').css('overflow-y', 'auto'); 1217 }); 1218 }); 1219 } 1220 1221 1222 /* Search modal, añadir a html, body, height:100%; */ 1223 $("#searchModal").on('show.bs.modal', function () { 1224 $('html, body').css('height', '100%'); 1225 }); 1226 $("#searchModal").on('hidden.bs.modal', function () { 1227 $('html, body').css('height', 'auto'); 1228 }); 1229 1230 1231 /* Funcionalidad del btn-more, js-showMore en espectaculo-presentación, las funciones del espectáculo */ 1232 if ($('.js-showMore').length > 0) { 1233 $('.functions-show').find('.functions-show__block').each(function (index) { 1234 if (index > 2) { 1235 $(this).addClass('hide'); 1236 } 1237 }); 1238 $('.functions-show').on('click', '.js-showMore', function (event) { 1239 event.preventDefault(); 1240 var totalShow = $(this).parents('.functions-show').find('.functions-show__block.hide').length; 1241 //console.log(totalShow); 1242 $(this).parents('.functions-show').find('.functions-show__block.hide').each(function (index) { 1243 1244 1245 if (index < 3) { 1246 $(this).removeClass('hide'); 1247 } 1248 1249 }); 1250 if (totalShow - 1 < 3) { 1251 $('.functions-show .js-showMore').addClass('hide'); 1252 $('.functions-show .btn-more').css({'margin-top':'0px','margin-bottom':'0px'}) 1253 } 1254 if (!$('iframe').length > 0) { 1255 $("html, body").getNiceScroll().resize(); 1256 } 1257 1258 }); 1259 } 1260 1261 /* Funcionalidad para ocultar en responsive los dÃas del calendario que no tengan ningún evento. Primero en */ 1262 if ($('.block-calendary__days').length > 0) { 1263 if ($(document).width() < 1200) { 1264 $('.block-calendary__days').find('.item-box').children('.hide').each(function (index) { 1265 $(this).parents('.block-calendary__days--item').addClass('hide'); 1266 1267 }); 1268 /*Contamos el número de clases de item (evento) con el número de clases de hide (sin evento), si son iguales, ese mes está vacÃo, añadir texto*/ 1269 $('.calendar-accordion .wrap-content-calendar').each(function (index) { 1270 if ($(this).find('.block-calendary__days--item:not(.day-opacity)').length == $(this).find('.block-calendary__days--item.hide').length) { 1271 $(this).find('.block-calendary__days').append('<h4>' + Drupal.t('No hay eventos en este mes aún notificados') + '</h4>'); 1272 } 1273 }); 1274 } 1275 } 1276 1277 /* ESTAS LÃNEAS DE CÃDIGO SIRVEN PARA REINICIAR LA FUNCIONALIDAD DEL NICESCROLL CUANDO SE MUESTRA UNA TAB O SE DESPLIEGA UN ACORDEON*/ 1278 $('.page-menu__list a[data-toggle="tab"]').on('shown.bs.tab', function (e) { 1279 if (!$('iframe').length > 0) { 1280 $("html, body").getNiceScroll().resize(); 1281 } 1282 loadSwiperGalleryShow(); 1283 }); 1284 1285 $('.wrap-accordion').each(function (index) { 1286 var idAccordion = $(this).find('.collapse').attr('id'); 1287 $('#' + idAccordion).on('shown.bs.collapse', function () { 1288 if (!$('iframe').length > 0) { 1289 $("html, body").getNiceScroll().resize(); 1290 } 1291 }); 1292 }); 1293 1294 $(document).on('click', 'a.btn-abono[href^="#"]', function (event) { 1295 //event.preventDefault(); 1296 1297 $('html, body').animate({ 1298 scrollTop: $($.attr(this, 'href')).offset().top 1299 }, 500); 1300 }); 1301 1302 /* Ocultar la modal del buscador cuando le das a la lupa o al enter*/ 1303 $('body').on('click', '.modal-search__box #edit-submit-search', function (event) { 1304 $('#searchModal').modal('hide'); 1305 }); 1306 $('#views-exposed-form-search-page-1 .form-autocomplete.form-text').keypress(function (event) { 1307 if (event.which == 13) { 1308 $('#searchModal').modal('hide'); 1309 } 1310 }); 1311 1312 /* Page-menu tabs with scroll to content */ 1313 $('.page-menu').on('shown.bs.tab', 'a[data-toggle="tab"]', function (e){ 1314 var href = $(this).attr('href'); 1315 $('html, body').animate({ 1316 scrollTop: $(href).offset().top - 130 1317 }, 'slow'); 1318 e.preventDefault(); 1319 }); 1320 /* Links turnos show tabs and scroll to content */ 1321 $('.lista-tipo-abonos').on('shown.bs.tab', 'a.js-tab-scroll[data-toggle="tab"]', function (e) { 1322 1323 var hrefLi = $(this).attr('data-li-active'); 1324 $(hrefLi).siblings('li').removeClass('active'); 1325 $(hrefLi).addClass('active'); 1326 $('html, body').animate({ 1327 scrollTop: $(hrefLi).offset().top - 100 1328 }, 'slow'); 1329 e.preventDefault(); 1330 }); 1331 /* Links turnos botones rojos scroll to content, un poquito más arriba */ 1332 $('.content-abonos').on('shown.bs.tab', 'a.btn-abono[data-toggle="tab"]', function (e) { 1333 e.preventDefault(); 1334 var idParent = $(this).parent('.tab-pane').attr('id'); 1335 $('html, body').animate({ 1336 scrollTop: $("#" + id).offset().top + 200 1337 }, 'slow'); 1338 1339 }); 1340 1341 if($('.collapsible-mobile').length > 0) { 1342 if($(window).width() < 992) { 1343 var text = $('.collapsible-mobile').html(); 1344 1345 if(text.split(' ').length > 120) { 1346 $('.collapsible-mobile').addClass('text-collapsible'); 1347 $('.text-collapsible-cover').css('display', 'block'); 1348 $('.timeline').css('margin-top', '12%'); 1349 } 1350 } 1351 } 1352 1353 if ($('.js-readMore').length > 0) { 1354 1355 if($(window).width() < 992) { 1356 $('.js-readMore a').on('click', function(e) { 1357 e.preventDefault(); 1358 $(this).parent().parent().parent().css('max-height', '100%'); 1359 $(this).parent().parent().parent().css('overflow', 'inherit'); 1360 $(this).parent().parent().parent().css('margin-bottom', '40px'); 1361 $(this).parent().siblings('.text-collapsible-cover').css('opacity', '0'); 1362 $(this).parent().siblings('.read-less').css('display', 'block'); 1363 $(this).parent().css('display', 'none'); 1364 $(this).parent().parent().css('background', '0'); 1365 }); 1366 $('.js-readLess a').on('click', function(e) { 1367 e.preventDefault(); 1368 $(this).parent().parent().parent().css('max-height', '130px'); 1369 $(this).parent().parent().parent().css('margin-bottom', '0'); 1370 $(this).parent().parent().parent().css('overflow', 'hidden'); 1371 $(this).parent().siblings('.text-collapsible-cover').css('opacity', '1'); 1372 $(this).parent().siblings('.read-more').css('display', 'block'); 1373 $(this).parent().css('display', 'none'); 1374 $(this).parent().parent().css('background', ''); 1375 }); 1376 } 1377 1378 } 1379}); 1380
1381//Zoom image on "Season ticket" page 1382jQuery(document).ready(function ($) { 1383 if ($('#img-zoom-plano').length > 0) { 1384 var url_img = document.getElementById('img-zoom-plano').src; 1385 if(url_img){ 1386 $('#img-zoom-1').zoom({url:url_img}); 1387 } 1388 } 1389 if ($('#mapas_gif').length > 0) { 1390 $('.zoom').each(function (i) { 1391 var id_plano = $(this).find('.zoomImg').attr('id'); 1392 var id_img = '#' + $(this).attr('id'); 1393 var url_img = document.getElementById(id_plano).src; 1394 if(url_img){ 1395 $(id_img).zoom({url:url_img}); 1396 } 1397 }); 1398 } 1399}); 1400 1401/** 1402 * Change URL to redirect download form on 'Download component' 1403 */ 1404(function ($, Drupal, drupalSettings) { 1405 Drupal.behaviors.downloadFileForm = { 1406 attach: function (context, drupalSettings) { 1407 $('.btn-download.form-download a', context).each(function () { 1408 var url_form = drupalSettings.url_download_file_form; 1409 var vfile = $(this).attr("href"); 1410 var ftoken = encodeURIComponent(window.btoa(vfile)); 1411 $(this,context).attr("href",url_form+'?f_path='+ftoken); 1412 }); 1413 } 1414 }; 1415})(jQuery, Drupal, drupalSettings); 1416 1417//Close modal after clicking on search button 1418(function ($, Drupal) { 1419 Drupal.behaviors.closeSearchModal = { 1420 attach: function (context, settings) { 1421 $('#views-exposed-form-search-page-1 #edit-submit-search', context).once('closeSearchModal').on('click', function() { 1422 $('#searchModal').modal('hide'); 1423 }); 1424 1425 } 1426 }; 1427})(jQuery, Drupal); 1428 1429// Activa tab de acuerdo a #hash 1430(function ($, Drupal) { 1431 if($('.paragraph--type--bp-tabs').length > 0){ 1432 $(document).on('click', '.paragraph--type--bp-tabs .page-menu__list--item', function () { 1433 var href_tab = $(this).children().attr("href") 1434 $(this).siblings().removeClass('active'); 1435 $(this).addClass('active'); 1436 $($(this).parent().siblings().children()).each(function () { 1437 var attr_id = '#' + $(this).attr('id'); 1438 if(attr_id == href_tab){ 1439 $(this).siblings().removeClass('active'); 1440 $(this).addClass('active'); 1441 $('html, body').animate({ 1442 scrollTop: window.location.hash ? $(window.location.hash).offset().top + 100 : 0 1443 }, 'slow'); 1444 } 1445 }); 1446 }); 1447 $('.paragraph--type--bp-tabs .page-menu__list[role="tablist"] li a').each(function () { 1448 if(this.hash == window.location.hash){ 1449 $(this).parent().siblings().removeClass('active'); 1450 $(this).parent().addClass('active'); 1451 } 1452 $('html, body').animate({ 1453 scrollTop: window.location.hash ? $(window.location.hash).offset().top + 100 : 0 1454 }, 'slow'); 1455 }); 1456 $('.paragraph--type--bp-tabs .tab-content .tab-pane[role="tabpanel"]').each(function () { 1457 var attr_id = '#' + $(this).attr('id'); 1458 if(attr_id == window.location.hash){ 1459 $(this).siblings().removeClass('active'); 1460 $(this).addClass('active'); 1461 } 1462 }); 1463 } 1464 1465 if($('.timeline__bar').length > 0) { 1466 if($(window).width() < 992) { 1467 $('.timeline__bar ul li:nth-child(2n)').outerHeight($('.timeline__bar ul li:nth-child(2n)').children('span').outerHeight()); 1468 } 1469 } 1470 1471})(jQuery, Drupal); 1472 1473//Muevo las funciones pasadas/vendidas al final de la lista en los espectáculos 1474(function ($, Drupal) { 1475 Drupal.behaviors.orderFunciones = { 1476 attach: function (context) { 1477 $('.functions-show .functions-show__block').each(function(){ 1478 if($(this).hasClass('sold-out')){ 1479 $(this).insertBefore('.btn-more'); 1480 } 1481 }); 1482 } 1483 }; 1484})(jQuery, Drupal);
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.