1jQuery(document).ready( function($) { 2 3 if ( $('body').find('.dipl_testimonial_slider').length > 0 ) { 4 $('body').find('.dipl_testimonial_slider').each( function() { 5 // Init the slider. 6 const $this = $( this ); 7 dipl_init_testimonial_slider( $this ); 8 } ); 9 } 10 11 // On resize, set arrow position again. 12 $( window ).resize( function() { 13 if ( $('body').find('.dipl_testimonial_slider').length > 0 ) { 14 $('body').find('.dipl_testimonial_slider').each( function() { 15 dipl_set_testimonial_slider_arrows( $( this ) ); 16 } ); 17 } 18 } ); 19} ); 20 21// Init slider for testimonial. 22function dipl_init_testimonial_slider(Â $moduleObj ) { 23 24 if ( $moduleObj.find( '.swiper-container' ).length < 1 || $moduleObj.find( '.swiper-slide' ).length < 1 ) { 25 return; 26 } 27 28 // The VB re-runs this on every attrs change. Swiper actively rewrites the DOM it manages 29 // (loop clones, inline slide styles, direction classes), so reinitializing on top of its 30 // own leftovers without destroying the previous instance first silently drops changes 31 // like direction. Destroy any existing instance on this container before making a new one. 32 let $existingSwiperEl = $moduleObj.find( '.swiper-container' ).get( 0 ); 33 if ( $existingSwiperEl && $existingSwiperEl.swiper ) { 34 $existingSwiperEl.swiper.destroy( true, true ); 35 } 36 37 // Set arrows position. 38 dipl_set_testimonial_slider_arrows( $moduleObj ); 39 40 let $orderClass = $moduleObj.prop('class').match(/(dipl_testimonial_slider\_[^\s]*)/)[0], 41 $orderNumber = $orderClass.replace( 'dipl_testimonial_slider', '' ), 42 43 $slidesPerGroup = 1, 44 $slidesPerGroupIpad = 1, 45 $slidesPerGroupMobile = 1, 46 $slidesPerGroupSkip = 0, 47 $slidesPerGroupSkipIpad = 0, 48 $slidesPerGroupSkipMobile = 0, 49 $testimonials_per_view = 1, 50 $testimonials_per_view_ipad = 1, 51 $testimonials_per_view_mobile = 1, 52 $testimonials_space_between = 0, 53 $testimonials_space_between_ipad = 0, 54 $testimonials_space_between_mobile = 0; 55 56 const wrapModule = $moduleObj.find( '.dipl_swiper_wrapper' ); 57 58 // Get the data as attr, instead of data, because on change on VB attrs it also get changed. 59 const settings = { 60 'direction' : wrapModule.attr( 'data-direction' ), 61 'slide_effect' : wrapModule.attr( 'data-slide_effect' ), 62 'show_arrow' : wrapModule.attr( 'data-show_arrow' ), 63 'show_control' : wrapModule.attr( 'data-show_control_dot' ), 64 'loop' : wrapModule.attr( 'data-slider_loop' ), 65 'autoplay' : wrapModule.attr( 'data-autoplay' ), 66 'autoplay_speed' : wrapModule.attr( 'data-autoplay_speed' ), 67 'transition_duration' : wrapModule.attr( 'data-slide_transition_duration' ), 68 'pause_on_hover' : wrapModule.attr( 'data-pause_on_hover' ), 69 'auto_height_slider' : wrapModule.attr( 'data-auto_height_slider' ), 70 'enable_coverflow_shadow' : wrapModule.attr( 'data-enable_coverflow_shadow' ), 71 'coverflow_rotate' : wrapModule.attr( 'data-coverflow_rotate' ), 72 'coverflow_depth' : wrapModule.attr( 'data-coverflow_depth' ), 73 'dynamic_bullets' : wrapModule.attr( 'data-enable_dynamic_dots' ), 74 'per_view' : wrapModule.attr( 'data-per_view' ), 75 'per_view_tablet' : wrapModule.attr( 'data-per_view_tablet' ), 76 'per_view_phone' : wrapModule.attr( 'data-per_view_phone' ), 77 'per_group' : wrapModule.attr( 'data-per_group' ), 78 'per_group_tablet' : wrapModule.attr( 'data-per_group_tablet' ), 79 'per_group_phone' : wrapModule.attr( 'data-per_group_phone' ), 80 'space_between_slides' : wrapModule.attr( 'data-space_between_slides' ), 81 'space_between_slides_tablet' : wrapModule.attr( 'data-space_between_slides_tablet' ), 82 'space_between_slides_phone' : wrapModule.attr( 'data-space_between_slides_phone' ), 83 }; 84 85 let slideEffect = ( settings.slide_effect ) ?? 'slide'; 86 if ( 'slide' === slideEffect || 'coverflow' === slideEffect ) { 87 88 $testimonials_per_view = ( settings?.per_view ) ? settings.per_view : '1'; 89 $testimonials_per_view_ipad = ( settings?.per_view_tablet ) ? settings.per_view_tablet : $testimonials_per_view; 90 $testimonials_per_view_mobile = ( settings?.per_view_phone ) ? settings.per_view_phone : $testimonials_per_view_ipad; 91 92 $testimonials_space_between = ( settings?.space_between_slides ) ? settings.space_between_slides : '20p
92x'; 93 $testimonials_space_between_ipad = ( settings?.space_between_slides_tablet ) ? settings.space_between_slides_tablet : $testimonials_space_between; 94 $testimonials_space_between_mobile = ( settings?.space_between_slides_phone ) ? settings.space_between_slides_phone : $testimonials_space_between_ipad; 95 96 $slidesPerGroup = ( settings?.per_group ) ? settings.per_group : '1'; 97 $slidesPerGroupIpad = ( settings?.per_group_tablet ) ? settings.per_group_tablet : $slidesPerGroup; 98 $slidesPerGroupMobile = ( settings?.per_group_phone ) ? settings.per_group_phone : $slidesPerGroupIpad; 99 100 if ( $testimonials_per_view > $slidesPerGroup && 1 !== $slidesPerGroup ) { 101 $slidesPerGroupSkip = parseInt( $testimonials_per_view ) - parseInt( $slidesPerGroup ); 102 } 103 if ( $testimonials_per_view_ipad > $slidesPerGroupIpad && 1 !== $slidesPerGroupIpad ) { 104 $slidesPerGroupSkipIpad = parseInt( $testimonials_per_view_ipad ) - parseInt( $slidesPerGroupIpad ); 105 } 106 if ( $testimonials_per_view_mobile > $slidesPerGroupMobile && 1 !== $slidesPerGroupMobile ) { 107 $slidesPerGroupSkipMobile = parseInt( $testimonials_per_view_mobile ) - parseInt( $slidesPerGroupMobile ); 108 } 109 } 110 111 let autoplay_speed = ( settings?.autoplay_speed ) ?? 3000, 112 pause_on_hover = ( settings?.pause_on_hover ) ?? 'on', 113 transition_duration = ( settings?.transition_duration ) ?? 1000, 114 loop_param = ( 'on' === settings?.loop ) ? true : false, 115 // Swiper's dynamicBullets slides bullets along the axis matching the slider's own 116 // direction (left for horizontal, top for vertical) on the assumption the bullet row 117 // itself is stacked to match â but this module always renders bullets in a plain 118 // horizontal row regardless of slide direction. In vertical mode that leaves Swiper 119 // applying an ever-growing negative "top" to every bullet each slide change, pushing 120 // the whole row up and out of the pagination wrapper's overflow:hidden. Force it off 121 // for vertical rather than let it fight a bullet layout it wasn't built for. 122 dynamic_bullets = ( 'on' === settings?.dynamic_bullets && 'vertical' !== settings?.direction ) ? true : false; 123
124 let $show_arrow = 'false'; 125 if ( 'on' === settings?.show_arrow ) { 126 $show_arrow = { 127 nextEl: '.' + $orderClass + ' .swiper-button-next', 128 prevEl: '.' + $orderClass + ' .swiper-button-prev', 129 }; 130 } 131 132 let $show_control = false; 133 if ( 'on' === settings?.show_control ) { 134 $show_control = { 135 el: '.' + $orderClass + ' .swiper-pagination', 136 dynamicBullets: dynamic_bullets, 137 clickable: true, 138 } 139 } 140 141 let $autoplay_param = 0; 142 if ( 'on' === settings?.autoplay ) { 143 $autoplay_param = { 144 delay: parseInt( autoplay_speed ), 145 disableOnInteraction: ( 'on' === pause_on_hover ) ? true : false, 146 }; 147 } 148 149 let $slide_setting_cube = false; 150 if ( 'cube' === slideEffect ) { 151 $slide_setting_cube = { 152 shadow: false, 153 slideShadows: false, 154 }; 155 } 156 157 let $slide_setting_coverflow = false; 158 if ( 'coverflow' === slideEffect ) { 159 $slide_setting_coverflow = { 160 rotate: ( settings?.coverflow_rotate ) ?? 40, 161 stretch: 0, 162 depth: ( settings?.coverflow_depth ) ?? 100, 163 modifier: 1, 164 slideShadows : ( settings?.enable_coverflow_shadow ) ?? false, 165 }; 166 loop_param = true; 167 } 168 169 let $fade = false;
170 if ( 'fade' === slideEffect ) { 171 $fade = { crossFade: true }; 172 } 173 174 // Remove the pagination clases. 175 if ( wrapModule.find( '.swiper-pagination' ).hasClass( 'swiper-pagination-bullets-dynamic' ) ) { 176 wrapModule.find( '.swiper-pagination' ).removeClass( 'swiper-pagination-bullets-dynamic' ).css( 'width', 'auto' ); 177 } 178 179 // Vertical mode: slidesPerView is 'auto', not numeric. A numeric slidesPerView makes 180 // Swiper compute its *navigation* math (how far "next" moves) from the assumption that 181 // every slide is the same forced size â so resetting slide heights back to natural 182 // afterward (needed so content isn't cut) leaves that navigation math based on a uniform 183 // size that no longer matches reality, which is what made "next" overshoot into empty 184 // space. 'auto' mode measures each slide's real size for navigation too, so it stays 185 // correct once we tell Swiper to re-measure (see dipl_update_testimonial_slider_height). 186 // slidesPerGroupSkip is intentionally left at 0 for vertical â it's an odd combination 187 // with 'auto' mode we don't need here (Per View no longer maps to a Swiper size setting). 188 // Vertical only ever applies with the plain 'slide' effect â cube/coverflow position 189 // slides with 3D transforms our stacking-based height math can't interpret (verified live: 190 // coverflow + vertical produced a container over 2900px tall), and loop mode can't compute 191 // its clone/wrap math against slidesPerView:'auto'. The Direction field hides itself in the 192 // VB once Slide Effect isn't 'slide', but that only stops new selections â a stored 193 // direction:"vertical" from before an effect switch would still reach here, so the effect 194 // check has to be enforced at this level too, not just in the settings panel. 195 let $direction = ( 'vertical' === settings?.direction && 'slide' === slideEffect ) ? 'vertical' : 'horizontal'; 196 let $auto_height_slider = ( 'vertical' === $direction ) ? false : ( ( 'on' === settings?.auto_height_slider ) ? true : false ); 197 198 // Vertical + Loop is broken at the Swiper level, not just an "odd combination" (see comment 199 // above) â verified live: loop's own clone-boundary repositioning (loopFix, itself re-run by 200 // this module's height-recalculation on every transitionEnd) leaves the wrapper's translate 201 // permanently desynced from its actual rendered position after the very first slide change, 202 // which strands Swiper's internal "animating" flag true forever â every following transition 203 // (autoplay or manual) silently no-ops from that point on. Force loop off for vertical the 204 // same way it's forced on for coverflow above, rather than let a user select a combination 205 // that looks fine in the builder and then locks up on the front end. 206 if ( 'vertical' === $direction ) { 207 loop_param = false; 208 } 209 210 var swipperSlider = new Swiper( '.' + $orderClass + ' .swiper-container', { 211 direction: $direction, 212 slidesPerView: ( 'vertical' === $direction ) ? 'auto' : parseInt( $testimonials_per_view ), 213 autoplay: $autoplay_param, 214 spaceBetween: parseInt( $testimonials_space_between ), 215 slidesPerGroup: parseInt( $slidesPerGroup ), 216 slidesPerGroupSkip: ( 'vertical' === $direction ) ? 0 : parseInt( $slidesPerGroupSkip ), 217 effect: slideEffect, 218 cubeEffect: $slide_setting_cube, 219 coverflowEffect: $slide_setting_coverflow, 220 fadeEffect: $fade, 221 autoHeight: $auto_height_slider, 222 speed: parseInt( transition_duration ), 223 loop: loop_param, 224 pagination: $show_control, 225 navigation: $show_arrow, 226 grabCursor: true, 227 breakpoints: { 228 1080: { 229 slidesPerView: ( 'vertical' === $direction ) ? 'auto' : parseInt( $testimonials_per_view ), 230 spaceBetween: parseInt( $testimonials_space_between ), 231 slidesPerGroup: parseInt( $slidesPerGroup ), 232 slidesPerGroupSkip: ( 'vertical' === $direction ) ? 0 : parseInt( $slidesPerGroupSkip ), 233 }, 234 767: { 235 slidesPerView: ( 'vertical' === $direction ) ? 'auto' : parseInt( $testimonials_per_view_ipad ), 236 spaceBetween: parseInt( $testimonials_space_between_ipad ), 237 slidesPerGroup: parseInt( $slidesPerGroupIpad ), 238 slidesPerGroupSkip: ( 'vertical' === $direction ) ? 0 : parseInt( $slidesPerGroupSkipIpad ), 239 }, 240 0: { 241 slidesPerView: ( 'vertical' === $direction ) ? 'auto' : parseInt( $testimonials_per_view_mobile ), 242 spaceBetween: parseInt( $testimonials_space_between_mobile ), 243 slidesPerGroup: parseInt( $slidesPerGroupMobile ),
244 slidesPerGroupSkip: ( 'vertical' === $direction ) ? 0 : parseInt( $slidesPerGroupSkipMobile ), 245 } 246 } 247 } ); 248 249 // Vertical mode: size the container to exactly fit however many testimonials Per View 250 // calls for, using their real rendered height. Per View itself isn't something Swiper 251 // tracks in 'auto' mode (its own params.slidesPerView is just the string 'auto'), so the 252 // three breakpoint values already resolved above are passed through directly instead. 253 if ( 'vertical' === $direction ) { 254 const $swiperContainer = jQuery( '.' + $orderClass + ' .swiper-container' ); 255 256 // (Re)init leaves the container's height unset/wrong until 257 // dipl_update_testimonial_slider_height's own settle-polling below finishes settling â a 258 // full VB attrs-change re-init tears down and rebuilds the whole Swiper instance (see 259 // comment above). Keep the height transition off during that settle window so the 260 // correction snaps instantly instead of visibly animating through the wrong intermediate 261 // values (the "grow then shrink" jump); only enable it afterward, once the slider is 262 // already showing its real height, so genuine slide-change height changes still animate 263 // smoothly. Window matches dipl_update_testimonial_slider_height's own ~1.5s poll 264 // give-up threshold. 265 $swiperContainer.css( 'transition', 'none' ); 266 window.setTimeout( function() { 267 $swiperContainer.css( 'transition', 'height ' + parseInt( transition_duration ) + 'ms ease' ); 268 }, 1600 ); 269 270 dipl_update_testimonial_slider_height( swipperSlider, $orderClass, $testimonials_per_view, $testimonials_per_view_ipad, $testimonials_per_view_mobile ); 271 272 // Only transitionEnd, not slideChange â slideChange fires the instant activeIndex 273 // updates, before the slide has actually translated into its final position, so 274 // measuring then captures a transient (wrong) size and applies it immediately. That 275 // premature write then fights with the transitionEnd correction on the same CSS height 276 // transition, producing a visible grow-then-shrink instead of one clean settle. 277 swipperSlider.on( 'transitionEnd', function() { 278 dipl_update_testimonial_slider_height( swipperSlider, $orderClass, $testimonials_per_view, $testimonials_per_view_ipad, $testimonials_per_view_mobile ); 279 } ); 280 swipperSlider.on( 'breakpoint', function() { 281 dipl_update_testimonial_slider_height( swipperSlider, $orderClass, $testimonials_per_view, $testimonials_per_view_ipad, $testimonials_per_view_mobile ); 282 } ); 283 284 // Namespaced per instance so re-initializing (the VB does this on every attrs 285 // change) replaces this listener instead of stacking a new one on top of it. 286 jQuery( window ).off( 'resize.' + $orderClass ).on( 'resize.' + $orderClass, function() { 287 dipl_update_testimonial_slider_height( swipperSlider, $orderClass, $testimonials_per_view, $testimonials_per_view_ipad, $testimonials_per_view_mobile ); 288 } ); 289 290 // An author image still loading at the moment of the calls above would make its card 291 // measure shorter than its true final size, clipping the bottom of the last visible 292 // slide â recheck once every image on the page (including these) has actually loaded. 293 jQuery( window ).off( 'load.' + $orderClass ).on( 'load.' + $orderClass, function() { 294 dipl_update_testimonial_slider_height( swipperSlider, $orderClass, $testimonials_per_view, $testimonials_per_view_ipad, $testimonials_per_view_mobile ); 295 } ); 296 } 297 298 wrapModule.addClass( 'dipl-slider-initialized' ); 299 if ( 'on' === pause_on_hover && 'on' === settings?.autoplay ) { 300 jQuery( '.' + $orderClass + ' .swiper-container' ).on( 'mouseleave', function(e) { 301 if ( typeof swipperSlider.autoplay.start === "function" ) { 302 swipperSlider.autoplay.start(); 303 } 304 } ); 305 jQuery( '.' + $orderClass + ' .swiper-container' ).on( 'mouseenter', function(e) { 306 if ( typeof swipperSlider.autoplay.stop === "function" ) { 307 swipperSlider.autoplay.stop(); 308 } 309 } ); 310 } 311 if ( 'on' !== settings?.loop ) { 312 swipperSlider.on( 'reachEnd', function() { 313 swipperSlider.autoplay = false; 314 } ); 315 } 316} 317 318// Vertical slider: reset every slide back to its natural content height, tell Swiper to 319// re-measure its own navigation state against that (safe in 'auto' slidesPerView mode â it 320// measures rather than forcing a uniform size back on), then set the container height to
321// exactly fit the slides currently in view. Measures the real rendered distance from the top 322// of the first visible slide to the bottom of the last one, rather than summing individual 323// slide heights and guessing how Swiper applies Space between Slides internally â that 324// measurement already reflects whatever spacing Swiper actually rendered between them. 325// perViewDesktop/Tablet/Mobile are the already-resolved Per View settings values â Swiper 326// itself has no usable Per View number in 'auto' mode (its own params.slidesPerView is just 327// the string 'auto'), so these are used directly instead. 328function dipl_update_testimonial_slider_height( swiperInstance, $orderClass, perViewDesktop, perViewTablet, perViewMobile ) { 329 if ( ! swiperInstance || 'vertical' !== swiperInstance.params.direction ) { 330 return; 331 } 332 333 let $slides = jQuery( '.' + $orderClass + ' .swiper-slide' ); 334 335 // Guarantee natural height regardless of anything Swiper may have set inline â this is a 336 // plain overwrite, not a CSS specificity fight, so it always wins. 337 $slides.css( 'height', 'auto' ); 338 339 // Re-measure each slide's current (now natural) size so Swiper's own navigation/grid math 340 // stays in sync with what's actually on screen instead of the stale numbers it started with. 341 // Deliberately NOT calling the full swiperInstance.update() here â in loop mode, update() 342 // internally re-runs slideTo(activeIndex, 0, ...), which calls setTransition(0) on the 343 // wrapper. If this height recalculation is still in flight while a real (speed > 0) slide 344 // transition is animating â e.g. transitionEnd firing while the resize/breakpoint/load 345 // listeners below are also queued â that nested setTransition(0) truncates the wrapper's 346 // active CSS transition before its transitionend event can fire, permanently stranding 347 // Swiper's internal `animating` flag at true (verified live: navigation and this height 348 // recalculation both silently stop working after that point, on the very first affected 349 // transition). Calling only the sizing sub-steps update() itself runs before its risky 350 // slideTo() gets the same grid refresh without that transition-truncation side effect. 351 if ( 'function' === typeof swiperInstance.updateSlides ) { 352 swiperInstance.updateSize(); 353 swiperInstance.updateSlides(); 354 swiperInstance.updateProgress(); 355 swiperInstance.updateSlidesClasses(); 356 } 357 358 // Mirrors the same 1080/767 breakpoints Swiper itself was configured with above. 359 let $winWidth = jQuery( window ).width(), 360 perView = parseInt( perViewDesktop ) || 1; 361 362 if ( $winWidth < 768 ) { 363 perView = parseInt( perViewMobile ) || perView; 364 } else if ( $winWidth < 1081 ) { 365 perView = parseInt( perViewTablet ) || perView; 366 } 367 368 let $container = jQuery( '.' + $orderClass + ' .swiper-container' ); 369 370 let measure = function() { 371 let activeIndex = swiperInstance.activeIndex, 372 lastIndex = Math.min( activeIndex + perView - 1, $slides.length - 1 ), 373 $last = $slides.eq( lastIndex ); 374 375 if ( ! $last.length ) { 376 return 0; 377 } 378 379 // Measured from the container's own top edge, not the first visible slide's top â 380 // there's typically a small offset between the two (the wrapper's own box model), 381 // and using the slide's top instead consistently came up short by that amount, 382 // clipping the bottom of the last visible slide by the same margin every time. 383 return $last.get( 0 ).getBoundingClientRect().bottom - $container.get( 0 ).getBoundingClientRect().top; 384 }; 385 386 let apply = function( value ) { 387 $container.css( 'height', value + 'px' ); 388 }; 389 390 let totalHeight = measure(); 391 if ( totalHeight > 0 ) { 392 apply( totalHeight ); 393 } 394 395 // A single recheck on the next frame isn't reliably enough â Swiper's own slide 396 // transition, an async-loading image, or a pending reflow can all still be settling for 397 // longer than one frame. Poll instead: keep re-measuring at intervals until two 398 // consecutive reads agree (layout has actually stopped changing), applying whatever the 399 // latest real measurement is each time rather than trusting the first one. Gives up after 400 // ~1.5s so a genuinely unstable layout doesn't poll forever. 401 // 402 // slideChange and transitionEnd can both fire for the same transition â clear any poll 403 // already running for this instance before starting a new one, so they don't stack. 404 if ( swiperInstance._diplHeightPoll ) { 405 window.clearInterval( swiperInstance._diplHeightPoll ); 406 } 407 408 let attempts = 0, 409 previous = totalHeight; 410 411 swiperInstance._diplHeightPoll = window.setInterval( function() { 412 attempts++; 413 let current = measure(); 414 415 if ( current > 0 && current !== previous ) { 416 apply( current ); 417 } 418 419 if ( ( current > 0 && current === previous ) || attempts >= 15 ) { 420 window.clearInterval( swiperInstance._diplHeightPoll ); 421 } 422 423 previous = current; 424 }, 100 ); 425} 426 427// Set arrows position. 428function dipl_set_testimonial_slider_arrows( $moduleObj ) { 429 430 let $winWidth = jQuery( window ).width(); 431 432 // let $arrows = $moduleObj.find('.dipl_swiper_navigation').data(); 433 let $arrows = { 434 "arrows_desktop" : $moduleObj.find('.dipl_swiper_navigation').attr( 'data-arrows_desktop' ), 435 "arrows_tablet" : $moduleObj.find('.dipl_swiper_navigation').attr( 'data-arrows_tablet' ), 436 "arrows_phone" : $moduleObj.find('.dipl_swiper_navigation').attr( 'data-arrows_phone' ) 437 } 438 if ( $arrows ) { 439 if ( $winWidth > 980 && typeof($arrows['arrows_desktop']) !== 'undefined' ) { 440 dipl_remove_arrows_classes( $moduleObj.find('.dipl_swiper_navigation') ); 441 $moduleObj.find('.dipl_swiper_navigation').addClass('dipl_arrows_'+$arrows['arrows_desktop']); 442 } 443 if ( $winWidth < 981 ) { 444 if ( typeof($arrows['arrows_tablet']) !== 'undefined' ) { 445 dipl_remove_arrows_classes( $moduleObj.find('.dipl_swiper_navigation') ); 446 $moduleObj.find('.dipl_swiper_navigation').addClass('dipl_arrows_'+$arrows['arrows_tablet']); 447 } else if ( typeof($arrows['arrows_desktop']) !== 'undefined' ) { 448 dipl_remove_arrows_classes( $moduleObj.find('.dipl_swiper_navigation') ); 449 $moduleObj.find('.dipl_swiper_navigation').addClass('dipl_arrows_'+$arrows['arrows_desktop']); 450 } 451 } 452 if ( $winWidth < 768 ) { 453 if ( typeof($arrows['arrows_phone']) !== 'undefined' ) { 454 dipl_remove_arrows_classes( $moduleObj.find('.dipl_swiper_navigation') ); 455 $moduleObj.find('.dipl_swiper_navigation').addClass('dipl_arrows_'+$arrows['arrows_phone']); 456 } else if ( typeof($arrows['arrows_tablet']) !== 'undefined' ) { 457 dipl_remove_arrows_classes( $moduleObj.find('.dipl_swiper_navigation') ); 458 $moduleObj.find('.dipl_swiper_navigation').addClass('dipl_arrows_'+$arrows['arrows_tablet']); 459 } else if ( typeof($arrows['arrows_desktop']) !== 'undefined' ) { 460 dipl_remove_arrows_classes( $moduleObj.find('.dipl_swiper_navigation') ); 461 $moduleObj.find('.dipl_swiper_navigation').addClass('dipl_arrows_'+$arrows['arrows_desktop']); 462 } 463 } 464 } 465} 466 467// Get slider arrow classes. 468function dipl_get_arrows_classes() { 469 return [ 470 'dipl_arrows_top_left', 'dipl_arrows_top_center', 'dipl_arrows_top_right', 471 'dipl_arrows_bottom_left', 'dipl_arrows_bottom_center', 'dipl_arrows_bottom_right', 472 'dipl_arrows_outside', 'dipl_arrows_inside', 473 'dipl_arrows_vertical_outside', 'dipl_arrows_vertical_inside', 474 ]; 475} 476 477// Remove slider arrow classes. 478function dipl_remove_arrows_classes( $element ) {
479 let $arrowClasses = dipl_get_arrows_classes(); 480 $element.removeClass( $arrowClasses.join(' ') ); 481}
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.