HEX
Server: Apache
System: Linux web5.visualcom.es 4.18.0-477.21.1.lve.1.el8.x86_64 #1 SMP Tue Sep 5 23:08:35 UTC 2023 x86_64
User: ensaco.es (10019)
PHP: 8.3.32
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/ensaco.es/httpdocs/wp-content/plugins/bb-plugin/modules/button-group/js/settings.js
(function ($) {
    FLBuilder.registerModuleHelper( 'button-group', {
        init: function() {
            var form   = $( '.fl-builder-settings' ),
                layout = form.find( 'select[name=layout]' ),
                width  = form.find( 'select[name=width]' );
            
            this._toggleAlignField();
            layout.on( 'change', this._toggleAlignField );
            width.on( 'change', this._toggleAlignField );
        },
        
        /**
         * Toggle the Align field depending on the value of Layout and Width.
         */
        _toggleAlignField: function () {
            var form   = $( '.fl-builder-settings' ),
                layout = form.find( 'select[name=layout]' ).val(),
                width  = form.find( 'select[name=width]' ).val();
            
            if ( 'vertical' === layout && '' === width ) {
                $( '#fl-field-align' ).hide();
            } else {
                $( '#fl-field-align' ).show();
            }
        }
    });
})(jQuery);