-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathscript.js
35 lines (29 loc) · 958 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
(function() {
$(window).load(function() {
populateThemesSelect();
initWithSelectedTheme();
$('#theme-selector').on('change', function() {
initWithSelectedTheme();
this.blur();
});
$('#switch').on('change', function() {
if ($('#switch').is(':checked')) {
horizonal.enable();
$('#theme-selector').attr('disabled', null);
} else {
horizonal.disable();
$('#theme-selector').attr('disabled', 'true');
}
});
});
function initWithSelectedTheme() {
var selectedTheme = $("#theme-selector").val();
horizonal.init(themes[selectedTheme].options);
}
function populateThemesSelect() {
var select = $("#theme-selector");
$.each(themes, function(name) {
select.append($("<option />").val(name).text(name));
});
}
})();