؍q}UA<oq}UAAGq}Upqeq}UA}q}UAPuyq}U`Ayq}UpA؍q}UB<oq}UBAHxq}UAt׎q}U4<}q}UAp2׎q}U4<}q}U@P2q}U0BD̋q}UPt׎q}U4<}q}U0B`2q}U6PBDq}U !`BDeq}UpBuq}UpBPB̋q}U@`t̋q}UPptq}U`qeq}UB}q}UBPuyq}U`Ayq}UpA؍q}UB<oq}UBBGxq}UBt׎q}U&4<}q}U`BP2q}U%BD̋q}UPt׎q}U(4<}q}UB`2q}U4BDeq}UBuq}UBPB̋q}U`t̋q}U ptq}U0Pqeq}UC}q}UCPuyq}Up`Ayq}UpA؍q}UC<oq}UC CGxq}U Ct׎q}U.4<}q}UBp2׎q}U/4<}q}UPBp2׎q}U04<}q}U@2׎q}U14<}q}U?2q}U>pCD̋q}UPt׎q}U34<}q}UpC2q}UMCDeq}UCuq}UCPB̋q}U`t̋q}Uptq}U qeq}UC}q}UCPuyq}U@`Ayq}UPpA؍q}UC<oq}UCCGxq}UCt׎q}U94<}q}UC2׎q}U:4<}q}U> u؍q}UD<\q}UjuPP>Uqq}UP>`3yp}UDq}U qeq}U0D}q}U0DPuyq}U`Ayq}UpAyq}UAyq}UAyq}UAyq}UAyq}U Aq}U0@DDq}UPmPDDeq}U`Duq}U`DPB̋q}Up`t̋q}Uptq}Uqeq}UpD}q}UpDPuyq}U`Ayq}UpA؍q}UD<oq}UDDGxq}UDt׎q}UE4<}q}UPDP2q}UqDD̋q}UPt׎q}UG4<}q}UD`2q}U DDeq}UDuq}UDPB̋q}U@`t̋q}UPptq}U`qeq}UD}q}UDPuyq}U`Ayq}UpA؍q}UE<oq}UEEGq}Uqeq}U E( 'jet_tricks_column_sticky' => 'true', ), ) ); $obj->add_control( 'jet_tricks_bottom_spacing', array( 'label' => esc_html__( 'Bottom Spacing', 'jet-tricks' ), 'type' => Elementor\Controls_Manager::NUMBER, 'default' => 50, 'min' => 0, 'max' => 500, 'step' => 1, 'condition' => array( 'jet_tricks_column_sticky' => 'true', ), ) ); $obj->add_responsive_control( 'jet_tricks_sticky_align', array( 'label' => esc_html__( 'Sticky Align', 'jet-tricks' ), 'type' => 'select', 'options' => array( '' => esc_html__( 'Default', 'jet-tricks' ), 'flex-start' => esc_html__( 'Top', 'jet-tricks' ), 'center' => esc_html__( 'Center', 'jet-tricks' ), 'flex-end' => esc_html__( 'Bottom', 'jet-tricks' ), ), 'default' => '', 'condition' => array( 'jet_tricks_column_sticky' => 'true', ), 'selectors' => array( '{{WRAPPER}}' => 'align-self: {{VALUE}};', ), ) ); $obj->add_control( 'jet_tricks_column_sticky_on', array( 'label' => __( 'Sticky On', 'jet-tricks' ), 'type' => Elementor\Controls_Manager::SELECT2, 'multiple' => true, 'label_block' => 'true', 'default' => array( 'desktop', 'tablet', ), 'options' => $breakpoints_list, 'condition' => array( 'jet_tricks_column_sticky' => 'true', ), 'render_type' => 'none', ) ); } /** * [column_before_render description] * @param [type] $element [description] * @return [type] [description] */ public function column_before_render( $element ) { $data = $element->get_data(); $type = isset( $data['elType'] ) ? $data['elType'] : 'column'; $settings = $data['settings']; if ( 'column' !== $type && 'container' !== $type ) { return false; } if ( isset( $settings['jet_tricks_column_sticky'] ) ) { $column_settings = array( 'id' => $data['id'], 'sticky' => filter_var( $settings['jet_tricks_column_sticky'], FILTER_VALIDATE_BOOLEAN ), 'topSpacing' => isset( $settings['jet_tricks_top_spacing'] ) ? $settings['jet_tricks_top_spacing'] : 50, 'bottomSpacing' => isset( $settings['jet_tricks_bottom_spacing'] ) ? $settings['jet_tricks_bottom_spacing'] : 50, 'stickyOn' => isset( $settings['jet_tricks_column_sticky_on'] ) ? $settings['jet_tricks_column_sticky_on'] : array( 'desktop', 'tablet' ), ); if ( filter_var( $settings['jet_tricks_column_sticky'], FILTER_VALIDATE_BOOLEAN ) ) { $element->add_render_attribute( '_wrapper', array( 'class' => 'jet-sticky-column', 'data-jet-settings' => json_encode( $column_settings ), ) ); $this->sticky_columns[] = $data['id']; } $this->columns_data[ $data['id'] ] = $column_settings; } } /** * [enqueue_scripts description] * * @return void */ public function enqueue_scripts() { if ( ! empty( $this->sticky_columns ) ) { wp_enqueue_script( 'jet-resize-sensor', jet_tricks()->plugin_url( 'assets/js/lib/resize-sensor/ResizeSensor.min.js' ), array( 'jquery' ), '1.7.0', true ); wp_enqueue_script( 'jet-sticky-sidebar', jet_tricks()->plugin_url( 'assets/js/lib/sticky-sidebar/sticky-sidebar.min.js' ), array( 'jquery', 'jet-resize-sensor', 'imagesloaded' ), '3.3.1', true ); } jet_tricks_assets()->elements_data['columns'] = $this->columns_data; } /** * Returns the instance. * * @since 1.0.0 * @access public * @return object */ public static function get_instance() { // If the single instance hasn't been set, set it now. if ( null == self::$instance ) { self::$instance = new self; } return self::$instance; } } } /** * Returns instance of Jet_Tricks_Elementor_Column_Extension * * @return object */ function jet_tricks_elementor_column_extension() { return Jet_Tricks_Elementor_Column_Extension::get_instance(); }