aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/app.js
blob: 9ad4ea1249b67e27366af94e45f99befbbeebc89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import Mustache from 'mustache';

var template;

var controls = [
    { id: 'MAIN', name: 'Main', volume: 50 },
];

function render_sliders(sliders) {
    var sliderContainer = document.getElementById('SliderContainer');
    for( var i=0; i<sliders.length; i++) {
        var node = Mustache.render(template, sliders[i]);
        sliderContainer.innerHTML += node;
        console.log(sliderContainer.innerHTML)
    }
}

export function init() {
    template = document.getElementById('slider-template').innerHTML;
    Mustache.parse(template);

    render_sliders(controls);
}