Skip to content

Commit

Permalink
Merge pull request StartBootstrap#84 from ankurk91/patch/js
Browse files Browse the repository at this point in the history
Update sb-admin.js
  • Loading branch information
davidtmiller authored Sep 11, 2018
2 parents 3963188 + 2f0a1fb commit 7faec7d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/sb-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"use strict"; // Start of use strict

// Toggle the side navigation
$("#sidebarToggle").click(function(e) {
$("#sidebarToggle").on('click',function(e) {
e.preventDefault();
$("body").toggleClass("sidebar-toggled");
$(".sidebar").toggleClass("toggled");
});

// Prevent the content wrapper from scrolling when the fixed side navigation hovered over
$('body.fixed-nav .sidebar').on('mousewheel DOMMouseScroll wheel', function(e) {
if ($window.width() > 768) {
if ($(window).width() > 768) {
var e0 = e.originalEvent,
delta = e0.wheelDelta || -e0.detail;
this.scrollTop += (delta < 0 ? 1 : -1) * 30;
Expand All @@ -19,7 +19,7 @@
});

// Scroll to top button appear
$(document).scroll(function() {
$(document).on('scroll',function() {
var scrollDistance = $(this).scrollTop();
if (scrollDistance > 100) {
$('.scroll-to-top').fadeIn();
Expand Down

0 comments on commit 7faec7d

Please sign in to comment.