orbit-basic/app/assets/javascripts/lib/site_set.js

66 lines
1.5 KiB
JavaScript

mSet = function() {
if($('.m_set_swich').prop('checked')) {
$('.m_set').fadeTo(300, 1).find('input').removeAttr('disabled');
} else {
$('.m_set').fadeTo(300, .33).find('input').attr('disabled','disabled');
};
};
$(function() {
if($('.terms').length) {
$('.terms').each(function() {
if($(this).prop('checked')) {
$(this).closest('.control-group').next('.control-group').show();
};
$(this).on({
change: function() {
$(this).closest('.control-group').next('.control-group').slideToggle();
}
});
});
};
if($('.m_set_swich').length) {
mSet();
$('.m_set_swich').on({
change: function() {
mSet();
},
});
$('.m-theme').each(function() {
if($(this).prop('checked')) {
$(this).closest('li').addClass('active');
};
$(this).on({
change: function() {
$(this).closest('li').addClass('active').siblings('li').removeClass('active');
},
});
});
}
if($('.ob-theme').length) {
$('.ob-theme').each(function() {
if($(this).prop('checked')) {
$(this).closest('li').addClass('active');
};
$(this).on({
change: function() {
$(this).closest('li').addClass('active').siblings('li').removeClass('active');
},
});
});
}
if($('.set-sidebar-state').length) {
if(window.localStorage.getItem('sidebarState') == 1) {
$('.set-sidebar-state').prop('checked',true).parent('.togglebox').removeClass('disable');
}
$('.set-sidebar-state').on({
change: function() {
if($(this).prop('checked')) {
sidebarState(1);
} else {
sidebarState(0);
}
}
})
}
})