Commit 3795eb5b authored by Florian Joriot's avatar Florian Joriot
Browse files

Mise en place du bouton pour propager les taux rému sur toute l'étape

parent c7ca9c93
Loading
Loading
Loading
Loading
+4 −0
Changes for public/css/app.css: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -28884,6 +28884,10 @@ ul.privileges-form li label {
  margin-top: 2px;
}
.etape-taux-remu {
  margin-top: 2px;
}
.etape-taux-mixite {
  margin-top: 2px;
}
+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+4 −0
Changes for public/css/odf.scss: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -7,6 +7,10 @@
  margin-top: 2px;
}

.etape-taux-remu {
  margin-top: 2px;
}

.etape-taux-mixite {
  margin-top: 2px;
}
+3 −0
Changes for public/js/app.js: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -74,6 +74,9 @@ $(function ()
    WidgetInitializer.add('etape-centre-cout', 'etapeCentreCout', function () {
        WidgetInitializer.includeJs(Util.url('js/offre-formation.js'));
    });
    WidgetInitializer.add('etape-taux-remu', 'etapeTauxRemu', function () {
        WidgetInitializer.includeJs(Util.url('js/offre-formation.js'));
    });
    WidgetInitializer.add('etape-taux-mixite', 'etapeTauxMixite', function () {
        WidgetInitializer.includeJs(Util.url('js/offre-formation.js'));
    });
+40 −0
Changes for public/js/offre-formation.js: 40 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -202,7 +202,47 @@ $.widget("ose.etapeCentreCout", {

});

/**
 * etapeTauxRemu
 */
$.widget("ose.etapeTauxRemu", {

    _create: function ()
    {
        var that = this;

        this.element.find("button.form-set-value").click(function (e)
        {
            console.log("test");

            var value = that.getElementEtapeSelect('tauxRemu').val();
            that.setFormValues('tauxRemu', value);
            e.stopPropagation();
        });
    },

    setFormValues: function (type, value)
    {
        this.getElementElementSelects(type).each(function ()
        {
            var canSetValue = value == "" || $(this).find("option[value=" + value + "]").length > 0;
            if (canSetValue) {
                $(this).selectpicker('val', value);
            }
        });
    },

    getElementEtapeSelect: function (type)
    {
        return this.element.find('select[name="' + type + '"]');
    },

    getElementElementSelects: function (type)
    {
        return this.element.find('select[name$="\\[' + type + '\\]"]');
    }

});


/**