xxl-job

common.1.js 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. $(function(){
  2. // 导航栏,选中样式处理,js遍历匹配url(遗弃)
  3. $(".nav-click").removeClass("active");
  4. $(".nav-click").each(function(){
  5. if( window.location.href.indexOf( $(this).find("a").attr("href") ) > -1){
  6. $(this).addClass("active");
  7. $(this).parents(".nav-click").addClass("active");
  8. }
  9. });
  10. // scrollup
  11. $.scrollUp({
  12. animation: 'fade', // fade/slide/none
  13. scrollImg: true
  14. });
  15. // logout
  16. $("#logoutBtn").click(function(){
  17. ComConfirm.show("确认注销登录?", function(){
  18. $.post(base_url + "/logout", function(data, status) {
  19. if (data.code == "200") {
  20. ComAlert.show(1, "注销成功", function(){
  21. window.location.href = base_url + "/";
  22. });
  23. } else {
  24. ComAlert.show(1, data.msg);
  25. }
  26. });
  27. });
  28. });
  29. // 左侧菜单状态,js + 后端 + cookie方式(新)
  30. $('.sidebar-toggle').click(function(){
  31. var adminlte_settings = $.cookie('adminlte_settings'); // 左侧菜单展开状态[adminlte_settings]:on=展开,off=折叠
  32. if ('off' == adminlte_settings) {
  33. adminlte_settings = 'on';
  34. } else {
  35. adminlte_settings = 'off';
  36. }
  37. $.cookie('adminlte_settings', adminlte_settings, { expires: 7 }); //$.cookie('the_cookie', '', { expires: -1 });
  38. });
  39. // 左侧菜单状态,js + cookie方式(遗弃)
  40. /*
  41. var adminlte_settings = $.cookie('adminlte_settings');
  42. if (adminlte_settings == 'off') {
  43. $('body').addClass('sidebar-collapse');
  44. }
  45. */
  46. });