| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- /* Admin layout options */
- $(document).on('ready', function() {
- $('#theme-switcher-wrapper .switch-toggle').on('click', this, function() {
- var dataToggle = $(this).prev().attr('data-toggletarget');
- $('body').toggleClass(dataToggle);
- if ( dataToggle = 'closed-sidebar' ) {
- $('#close-sidebar .glyph-icon').toggleClass('icon-angle-right').toggleClass('icon-angle-left');
- }
- });
- $('.switch-toggle[id="#boxed-layout"]').click(function(){
- if ( $('#boxed-layout').attr("checked") ) {
- $('.boxed-bg-wrapper').slideDown();
- } else {
- $('.boxed-bg-wrapper').slideUp();
- }
- });
- });
- /* Open theme switcher */
- $(function() {
- $(".theme-switcher").click(function() {
- $("#theme-options").toggleClass('active');
- });
- });
- /* Admin header style */
- $(function() {
- $('.set-adminheader-style').click(function() {
- $('.set-adminheader-style').removeClass('active');
- $(this).addClass('active');
- var newBg = $(this).attr('data-header-bg');
- $("#page-header").removeClass(function(index, css) {
- return (css.match(/(^|\s)bg-\S+/g) || []).join(' ');
- });
- $("#page-header").removeClass(function(index, css) {
- return (css.match(/(^|\s)font-\S+/g) || []).join(' ');
- });
- $('#page-header').addClass(newBg);
- });
- });
- /* Admin sidebar style */
- $(function() {
- $('.set-sidebar-style').click(function() {
- $('.set-sidebar-style').removeClass('active');
- $(this).addClass('active');
- var newBg = $(this).attr('data-header-bg');
- $("#page-sidebar").removeClass(function(index, css) {
- return (css.match(/(^|\s)bg-\S+/g) || []).join(' ');
- });
- $("#page-sidebar").removeClass(function(index, css) {
- return (css.match(/(^|\s)font-\S+/g) || []).join(' ');
- });
- $('#page-sidebar').addClass(newBg);
- });
- });
- /* Boxed layout background style */
- $(function() {
- $('.set-background-style').click(function() {
- $('.set-background-style').removeClass('active');
- $(this).addClass('active');
- var newBg = $(this).attr('data-header-bg');
- $("body").removeClass(function(index, css) {
- return (css.match(/(^|\s)pattern-\S+/g) || []).join(' ');
- });
- $("body").removeClass(function(index, css) {
- return (css.match(/(^|\s)full-\S+/g) || []).join(' ');
- });
- $("body").removeClass(function(index, css) {
- return (css.match(/(^|\s)bg-\S+/g) || []).join(' ');
- });
- $("body").removeClass(function(index, css) {
- return (css.match(/(^|\s)fixed-\S+/g) || []).join(' ');
- });
- $('body').addClass(newBg);
- });
- });
- /* Frontend header style */
- $(function() {
- $('.set-header-style').click(function() {
- $('.set-header-style').removeClass('active');
- $(this).addClass('active');
- var newBg = $(this).attr('data-header-bg');
- $(".main-header").removeClass(function(index, css) {
- return (css.match(/(^|\s)bg-\S+/g) || []).join(' ');
- });
- $(".main-header").removeClass(function(index, css) {
- return (css.match(/(^|\s)font-\S+/g) || []).join(' ');
- });
- $('.main-header').addClass(newBg);
- });
- });
- /* Frontend footer style */
- $(function() {
- $('.set-footer-style').click(function() {
- $('.set-footer-style').removeClass('active');
- $(this).addClass('active');
- var newBg = $(this).attr('data-header-bg');
- $(".main-footer").removeClass(function(index, css) {
- return (css.match(/(^|\s)bg-\S+/g) || []).join(' ');
- });
- $(".main-footer").removeClass(function(index, css) {
- return (css.match(/(^|\s)font-\S+/g) || []).join(' ');
- });
- $('.main-footer').addClass(newBg);
- });
- });
- /* Frontend top menu style */
- $(function() {
- $('.set-topmenu-style').click(function() {
- $('.set-topmenu-style').removeClass('active');
- $(this).addClass('active');
- var newBg = $(this).attr('data-header-bg');
- $(".top-bar").removeClass(function(index, css) {
- return (css.match(/(^|\s)bg-\S+/g) || []).join(' ');
- });
- $(".top-bar").removeClass(function(index, css) {
- return (css.match(/(^|\s)font-\S+/g) || []).join(' ');
- });
- $('.top-bar').addClass(newBg);
- });
- });
- /* Theme styler scroll */
- $(function() {
- $('.scroll-switcher').slimscroll({
- height: '100%',
- color: 'rgba(0,0,0,0.3)',
- size: '10px',
- alwaysVisible: true
- });
- //
- //$(".scroll-switcher").slimScroll({
- // destroy: true
- //});
- });
- function swither_resizer() {
- var windowHeight = $(window).height();
- $('#theme-switcher-wrapper').height(windowHeight / 1.4);
- }
- $(document).on('ready', function() {
- swither_resizer();
- });
- $(window).on('resize', function() {
- swither_resizer();
- });
|