( function( $ ) {
    /**
     * @param $scope The Widget wrapper element as a jQuery element
     * @param $ The jQuery alias
     */
    var WidgetCTIlineHandler = function( $scope, $ ) {
    	
        setTimeout(function(){
            $('.elementor > .elementor-element').each(function () {
                var _el_particle = $(this).find(".elementor-container .el-move-parents"),
                    _el_particle_remove = $(this).find(".elementor-widget-wrap .el-move-parents"),
                    _row_particle = $(this).find("> .elementor-container");
                _row_particle.before(_el_particle.clone());
                _el_particle_remove.remove();
            });

            $('.elementor > .elementor-element').each(function () {
                var _el_button = $(this).find(".elementor-container .el-move-child"),
                    _el_button_remove = $(this).find(".elementor-widget-wrap .el-move-child"),
                    _row_button = $(this).parents('.site');
                _row_button.before(_el_button.clone());
                _el_button_remove.remove();
            });

            $('.elementor-inner-section').each(function () {
                var _el_particle = $(this).find(".elementor-container .el-move-inner"),
                    _el_particle_remove = $(this).find(".elementor-widget-wrap .el-move-inner"),
                    _row_particle = $(this).find("> .elementor-container");
                _row_particle.before(_el_particle.clone());
                _el_particle_remove.remove();
            });
            
        }, 200);

    };

    // Make sure you run this code under Elementor.
    $( window ).on( 'elementor/frontend/init', function() {
        elementorFrontend.hooks.addAction( 'frontend/element_ready/ct_particle_animate.default', WidgetCTIlineHandler );
    } );
} )( jQuery );