1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-12-18 02:16:03 +01:00

clean up options code

This commit is contained in:
topkek 2014-11-28 21:59:05 +00:00 committed by czaks
parent 8de9b68f5f
commit e6da7b4682

View File

@ -16,16 +16,16 @@ $(function() {
if (window.Options && Options.get_tab('general')) { if (window.Options && Options.get_tab('general')) {
var selector = '#treeview-global>input'; var selector = '#treeview-global>input';
Options.extend_tab("general", "<label id='treeview-global'><input type='checkbox' /> "+_('Use tree view by default')+"</label>"); Options.extend_tab("general", "<label id='treeview-global'><input type='checkbox' /> "+_('Use tree view by default')+"</label>");
} $(selector).on('change', function() {
$(selector).on('change', function () { if (localStorage.treeview === 'true') {
localStorage.treeview = 'false';
} else {
localStorage.treeview = 'true';
}
});
if (localStorage.treeview === 'true') { if (localStorage.treeview === 'true') {
localStorage.treeview = 'false'; $(selector).attr('checked', 'checked');
} else {
localStorage.treeview = 'true';
} }
});
if (localStorage.treeview === 'true') {
$(selector).attr('checked', 'checked');
} }
}); });