| @@ -1,6 +1,5 @@ | ||
| 1 | 1 | <?php |
| 2 | -namespace Easyel\EasyElements\Widgets; | |
| 3 | 2 | use Elementor\Controls_Manager; |
| 4 | 3 | use Elementor\Group_Control_Image_Size; |
| 5 | 4 | use Elementor\Utils; |
| 6 | 5 | |
| @@ -28,15 +27,31 @@ | ||
| 28 | 27 | return [ 'gallery', 'image', 'photo', 'portfolio' ]; |
| 29 | 28 | } |
| 30 | 29 | |
| 31 | 30 | public function get_style_depends() { |
| 32 | - | |
| 33 | - return [ 'eel-gallery' ]; | |
| 31 | + $handle = 'eel-gallery-style'; | |
| 32 | + $css_path = plugin_dir_path( __FILE__ ) . 'css/gallery.css'; | |
| 33 | + if ( ! wp_style_is( $handle, 'registered' ) && file_exists( $css_path ) ) { | |
| 34 | + wp_register_style( | |
| 35 | + $handle, | |
| 36 | + plugins_url( 'css/gallery.css', __FILE__ ), | |
| 37 | + [], | |
| 38 | + defined( 'WP_DEBUG' ) && WP_DEBUG ? filemtime( $css_path ) : '1.0.0' | |
| 39 | + ); | |
| 40 | + } | |
| 41 | + return [ $handle ]; | |
| 34 | 42 | } |
| 35 | 43 | |
| 36 | 44 | public function get_script_depends() { |
| 37 | - | |
| 38 | - return [ 'eel-gallery' ]; | |
| 45 | + $handle = 'eel-simple-gallery-script'; | |
| 46 | + $js_path = plugin_dir_path( __FILE__ ) . 'js/simple-gallery.js'; | |
| 47 | + | |
| 48 | + // Normal script loading | |
| 49 | + if ( ! wp_script_is( $handle, 'registered' ) && file_exists( $js_path ) ) { | |
| 50 | + wp_register_script( $handle, plugins_url( 'js/simple-gallery.js', __FILE__ ), [], defined( 'WP_DEBUG' ) && WP_DEBUG ? filemtime( $js_path ) : '1.0.0', true ); | |
| 51 | + } | |
| 52 | + | |
| 53 | + return [ $handle ]; | |
| 39 | 54 | } |
| 40 | 55 | |
| 41 | 56 | protected function register_controls() { |
| 42 | 57 | |
| @@ -341,9 +356,9 @@ | ||
| 341 | 356 | 'hover_style' => 'icon', |
| 342 | 357 | ], |
| 343 | 358 | ] |
| 344 | 359 | ); |
| 345 | - $this->add_responsive_control( | |
| 360 | + $this->add_control( | |
| 346 | 361 | 'hover_icon_size', |
| 347 | 362 | [ |
| 348 | 363 | 'label' => esc_html__( 'Icon Size', 'easy-elements' ), |
| 349 | 364 | 'type' => \Elementor\Controls_Manager::SLIDER, |