Commit 5f9d585e by fengshuonan

调整自定义js

parent e98b9345
...@@ -6,9 +6,9 @@ $(function () { ...@@ -6,9 +6,9 @@ $(function () {
jQuery(document).on('click', '.mega-dropdown', function (e) { jQuery(document).on('click', '.mega-dropdown', function (e) {
e.stopPropagation() e.stopPropagation()
}); });
// ============================================================== // ==============================================================
// This is for the top header part and sidebar part // This is for the top header part and sidebar part
// ============================================================== // ==============================================================
var set = function () { var set = function () {
var width = (window.innerWidth > 0) ? window.innerWidth : this.screen.width; var width = (window.innerWidth > 0) ? window.innerWidth : this.screen.width;
var topOffset = 70; var topOffset = 70;
...@@ -34,9 +34,9 @@ $(function () { ...@@ -34,9 +34,9 @@ $(function () {
}; };
$(window).ready(set); $(window).ready(set);
$(window).on("resize", set); $(window).on("resize", set);
// ============================================================== // ==============================================================
// Theme options // Theme options
// ============================================================== // ==============================================================
$(".sidebartoggler").on('click', function () { $(".sidebartoggler").on('click', function () {
if ($("body").hasClass("mini-sidebar")) { if ($("body").hasClass("mini-sidebar")) {
$("body").trigger("resize"); $("body").trigger("resize");
...@@ -55,7 +55,9 @@ $(function () { ...@@ -55,7 +55,9 @@ $(function () {
}); });
// topbar stickey on scroll // topbar stickey on scroll
$(".fix-header .topbar").stick_in_parent({}); $(".fix-header .topbar").stick_in_parent({
});
// this is for close icon when navigation open in mobile view // this is for close icon when navigation open in mobile view
...@@ -67,18 +69,18 @@ $(function () { ...@@ -67,18 +69,18 @@ $(function () {
$(".sidebartoggler").on('click', function () { $(".sidebartoggler").on('click', function () {
$(".sidebartoggler i").toggleClass("ti-menu"); $(".sidebartoggler i").toggleClass("ti-menu");
}); });
// ============================================================== // ==============================================================
// Right sidebar options // Right sidebar options
// ============================================================== // ==============================================================
$(".right-side-toggle").click(function () { $(".right-side-toggle").click(function () {
$(".right-sidebar").slideDown(50); $(".right-sidebar").slideDown(50);
$(".right-sidebar").toggleClass("shw-rside"); $(".right-sidebar").toggleClass("shw-rside");
}); });
// ============================================================== // ==============================================================
// Auto select left navbar // Auto select left navbar
// ============================================================== // ==============================================================
$(function () { $(function () {
var url = window.location; var url = window.location;
var element = $('ul#sidebarnav a').filter(function () { var element = $('ul#sidebarnav a').filter(function () {
...@@ -94,9 +96,9 @@ $(function () { ...@@ -94,9 +96,9 @@ $(function () {
} }
}); });
// ============================================================== // ==============================================================
//tooltip //tooltip
// ============================================================== // ==============================================================
$(function () { $(function () {
$('[data-toggle="tooltip"]').tooltip() $('[data-toggle="tooltip"]').tooltip()
}) })
...@@ -112,9 +114,9 @@ $(function () { ...@@ -112,9 +114,9 @@ $(function () {
$(function () { $(function () {
$('#sidebarnav').metisMenu(); $('#sidebarnav').metisMenu();
}); });
// ============================================================== // ==============================================================
// Slimscrollbars // Slimscrollbars
// ============================================================== // ==============================================================
$('.scroll-sidebar').slimScroll({ $('.scroll-sidebar').slimScroll({
position: 'left' position: 'left'
, size: "5px" , size: "5px"
...@@ -155,20 +157,20 @@ $(function () { ...@@ -155,20 +157,20 @@ $(function () {
, color: '#dcdcdc' , color: '#dcdcdc'
}); });
// ============================================================== // ==============================================================
// Resize all elements // Resize all elements
// ============================================================== // ==============================================================
$("body").trigger("resize"); $("body").trigger("resize");
// ============================================================== // ==============================================================
// To do list // To do list
// ============================================================== // ==============================================================
$(".list-task li label").click(function () { $(".list-task li label").click(function () {
$(this).toggleClass("task-done"); $(this).toggleClass("task-done");
}); });
// ============================================================== // ==============================================================
// Login and Recover Password // Login and Recover Password
// ============================================================== // ==============================================================
$('#to-recover').on("click", function () { $('#to-recover').on("click", function () {
$("#loginform").slideUp(); $("#loginform").slideUp();
$("#recoverform").fadeIn(); $("#recoverform").fadeIn();
...@@ -177,7 +179,7 @@ $(function () { ...@@ -177,7 +179,7 @@ $(function () {
// ============================================================== // ==============================================================
// Collapsable cards // Collapsable cards
// ============================================================== // ==============================================================
$(document).on("click", ".card-actions a", function (e) { $(document).on("click", ".card-actions a", function(e) {
if (e.preventDefault(), $(this).hasClass("btn-close")) $(this).parent().parent().parent().fadeOut(); if (e.preventDefault(), $(this).hasClass("btn-close")) $(this).parent().parent().parent().fadeOut();
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment