Skip to content

Commit

Permalink
Updated JS scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
BobsProgrammingAcademy committed Nov 6, 2023
1 parent 72fcd9d commit 0b81a66
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions static/js/chart-area-demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Chart.defaults.global.defaultFontFamily = '-apple-system,system-ui,BlinkMacSyste
Chart.defaults.global.defaultFontColor = '#292b2c';

// Area Chart Example
var ctx = document.getElementById('myAreaChart');
var myLineChart = new Chart(ctx, {
const ctxAreaChart = document.getElementById('myAreaChart');
const myAreaChart = new Chart(ctxAreaChart, {
type: 'line',
data: {
labels: ['Clothes', 'Food', 'Electronics', 'Books', 'Films', 'Toys', 'Health'],
Expand Down
4 changes: 2 additions & 2 deletions static/js/chart-bar-demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Chart.defaults.global.defaultFontFamily = '-apple-system,system-ui,BlinkMacSyste
Chart.defaults.global.defaultFontColor = '#292b2c';

// Bar Chart Example
var ctx = document.getElementById('myBarChart');
var myLineChart = new Chart(ctx, {
const ctxBarChart = document.getElementById('myBarChart');
const myBarChart = new Chart(ctxBarChart, {
type: 'bar',
data: {
labels: ['Food', 'Books', 'Clothes', 'Electronics', 'Films', 'Toys', 'Health'],
Expand Down
4 changes: 2 additions & 2 deletions static/js/chart-pie-demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Chart.defaults.global.defaultFontFamily = '-apple-system,system-ui,BlinkMacSyste
Chart.defaults.global.defaultFontColor = '#292b2c';

// Pie Chart Example
var ctx = document.getElementById('myPieChart');
var myPieChart = new Chart(ctx, {
const ctxPieChart = document.getElementById('myPieChart');
const myPieChart = new Chart(ctxPieChart, {
type: 'pie',
data: {
labels: ['Auction 3', 'Auction 8', 'Auction 4', 'Auction 7'],
Expand Down
6 changes: 3 additions & 3 deletions static/js/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ $("#success-alert").fadeTo(500, 100).slideUp(100, function(){
// 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) {
var e0 = e.originalEvent,
let e0 = e.originalEvent,
delta = e0.wheelDelta || -e0.detail;
this.scrollTop += (delta < 0 ? 1 : -1) * 30;
e.preventDefault();
Expand All @@ -43,7 +43,7 @@ $("#success-alert").fadeTo(500, 100).slideUp(100, function(){

// Scroll to top button appear
$(document).on('scroll', function() {
var scrollDistance = $(this).scrollTop();
let scrollDistance = $(this).scrollTop();
if (scrollDistance > 100) {
$('.scroll-to-top').fadeIn();
} else {
Expand All @@ -53,7 +53,7 @@ $("#success-alert").fadeTo(500, 100).slideUp(100, function(){

// Smooth scrolling using jQuery easing
$(document).on('click', 'a.scroll-to-top', function(e) {
var $anchor = $(this);
let $anchor = $(this);
$('html, body').stop().animate({
scrollTop: ($($anchor.attr('href')).offset().top)
}, 1000, 'easeInOutExpo');
Expand Down

0 comments on commit 0b81a66

Please sign in to comment.