/**
 * @module package/ecoyn/core/bin/backend/controls/Setup/Steps/Payments
 * @author www.pcsg.de (Henning Leutz)
 */
define('package/ecoyn/core/bin/backend/controls/Setup/Steps/Payments', [

    'qui/QUI',
    'qui/controls/Control'

], function (QUI, QUIControl) {
    "use strict";

    return new Class({

        Extends: QUIControl,
        Type   : 'package/ecoyn/core/bin/backend/controls/Setup/Steps/Payments',

        Binds: [
            '$onImport'
        ],

        initialize: function (options) {
            this.parent(options);

            this.addEvents({
                onImport: this.$onImport
            });
        },

        $onImport: function () {
            this.getElm().getElements('[type="checkbox"]').addEvent('change', (event) => {
                let Input = event.target;

                if (Input.checked) {
                    Input.getParent('label').addClass('active');
                } else {
                    Input.getParent('label').removeClass('active');
                }
            });
        }
    });
});
