| @@ -8,10 +8,11 @@ | ||
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | namespace RadiusTheme\SB\Elementor\Helper; |
| 11 | 11 | |
| 12 | +use Elementor\Plugin; | |
| 13 | +use RadiusTheme\SB\Helpers\Fns; | |
| 12 | 14 | use RadiusTheme\SB\Helpers\BuilderFns; |
| 13 | -use RadiusTheme\SB\Helpers\Fns; | |
| 14 | 15 | |
| 15 | 16 | // Do not allow directly accessing this file. |
| 16 | 17 | if ( ! defined( 'ABSPATH' ) ) { |
| 17 | 18 | exit( 'This script cannot be accessed directly.' ); |
| @@ -599,24 +600,32 @@ | ||
| 599 | 600 | if ( preg_match( '/category/', $layout ) && ! empty( $settings['active_cat_slider'] ) ) { |
| 600 | 601 | $classes .= ' rtsb-slider-layout'; |
| 601 | 602 | } |
| 602 | 603 | |
| 603 | - if ( 'even' === $grid_type ) { | |
| 604 | - $masonry_class = ' rtsb-even'; | |
| 604 | + if ( 'equal' === $grid_type ) { | |
| 605 | + $masonry_class = ' rtsb-equal'; | |
| 605 | 606 | } elseif ( 'masonry' === $grid_type ) { |
| 606 | 607 | $masonry_class = ' rtsb-masonry'; |
| 608 | + } else { | |
| 609 | + $masonry_class = ' rtsb-even'; | |
| 607 | 610 | } |
| 608 | 611 | |
| 609 | 612 | if ( ! rtsb()->has_pro() || $is_carousel ) { |
| 610 | 613 | $masonry_class = ' rtsb-even'; |
| 611 | 614 | } |
| 615 | + | |
| 612 | 616 | if ( $is_carousel && ! empty( $settings['raw_settings']['always_show_nav'] ) ) { |
| 613 | 617 | $classes .= ' always-show-nav'; |
| 614 | 618 | } |
| 619 | + | |
| 615 | 620 | if ( ! empty( $settings['raw_settings']['inner_slider_always_show_nav'] ) ) { |
| 616 | 621 | $classes .= ' inner-slider-always-show-nav'; |
| 617 | 622 | } |
| 618 | 623 | |
| 624 | + if ( empty( $settings['raw_settings']['cols_mobile'] ) ) { | |
| 625 | + $classes .= ' rtsb-mobile-flex-row'; | |
| 626 | + } | |
| 627 | + | |
| 619 | 628 | $classes .= ' rtsb-' . $layout . $masonry_class . $loader_class; |
| 620 | 629 | |
| 621 | 630 | return apply_filters( 'rtsb/elementor/row/classes', $classes, $settings ); |
| 622 | 631 | } |
| @@ -678,9 +687,9 @@ | ||
| 678 | 687 | $d_col = 0 === $meta['d_cols'] ? self::default_columns( $meta['layout'] ) : $meta['d_cols']; |
| 679 | 688 | $t_col = 0 === $meta['t_cols'] ? 2 : $meta['t_cols']; |
| 680 | 689 | $m_col = 0 === $meta['m_cols'] ? 1 : $meta['m_cols']; |
| 681 | 690 | |
| 682 | - if ( \Elementor\Plugin::$instance->breakpoints->has_custom_breakpoints() ) { | |
| 691 | + if ( Plugin::$instance->breakpoints->has_custom_breakpoints() ) { | |
| 683 | 692 | // Widescreen. |
| 684 | 693 | $w_col = self::get_data( $settings, 'cols_widescreen' ); |
| 685 | 694 | $w_col = 0 === $w_col ? self::default_columns( $meta['layout'] ) : $w_col; |
| 686 | 695 | $w_group = self::get_data( $settings, 'cols_group_widescreen', 1 ); |
| @@ -931,10 +940,11 @@ | ||
| 931 | 940 | * |
| 932 | 941 | * @return void |
| 933 | 942 | */ |
| 934 | 943 | public static function register_scripts( $scripts ) { |
| 935 | - $caro = false; | |
| 936 | - $script = []; | |
| 944 | + $caro = false; | |
| 945 | + $masonry = false; | |
| 946 | + $script = []; | |
| 937 | 947 | |
| 938 | 948 | $script[] = 'jquery'; |
| 939 | 949 | |
| 940 | 950 | foreach ( $scripts as $sc => $value ) { |
| @@ -941,8 +951,12 @@ | ||
| 941 | 951 | if ( ! empty( $sc ) ) { |
| 942 | 952 | if ( 'isCarousel' === $sc ) { |
| 943 | 953 | $caro = $value; |
| 944 | 954 | } |
| 955 | + | |
| 956 | + if ( 'isMasonry' === $sc ) { | |
| 957 | + $masonry = $value; | |
| 958 | + } | |
| 945 | 959 | } |
| 946 | 960 | } |
| 947 | 961 | |
| 948 | 962 | if ( count( $scripts ) ) { |
| @@ -950,8 +964,12 @@ | ||
| 950 | 964 | * Scripts. |
| 951 | 965 | */ |
| 952 | 966 | if ( $caro ) { |
| 953 | 967 | $script[] = 'swiper'; |
| 968 | + } | |
| 969 | + | |
| 970 | + if ( $masonry ) { | |
| 971 | + $script[] = 'masonry'; | |
| 954 | 972 | } |
| 955 | 973 | |
| 956 | 974 | $script[] = 'rtsb-imagesloaded'; |
| 957 | 975 | $script[] = 'rtsb-public'; |