HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux srvntsweb01 6.8.0-55-generic #57-Ubuntu SMP PREEMPT_DYNAMIC Wed Feb 12 23:42:21 UTC 2025 x86_64
User: admntserv (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/www/credoplanning.com/wp-content/plugins/case-theme-core/assets/js/layout-control.js
(function($){
    "user strict";

    $( window ).on( 'elementor:init', function() {
        var LayoutControl = elementor.modules.controls.BaseData.extend( {
            onReady: function() {
                var self = this;
                var options = this.ui.radio;
                options.each(function(key, value){
                    $(value).on("click", function(){
                        options.each(function(key2, value2){
                            if($(value2).parent().hasClass("selected")){
                                $(value2).parent().removeClass("selected");
                            }
                        });
                       $(this).parent().addClass("selected");
                    });
                });
            },

            saveValue: function() {
                var self = this;
                var options = this.ui.radio;
                $.each(options, function(key, value){
                    if($(value).is(':checked')){
                        self.setValue( $(value).val() );
                    }
                });
            },

            onBeforeDestroy: function() {
                this.saveValue();
            }
        } );
        elementor.addControlView( 'layoutcontrol', LayoutControl );
    } );

}(jQuery));