creativetimofficial / ct-material-dashboard-pro

Material Dashboard Pro - Premium Bootstrap 5 Admin
https://demos.creative-tim.com/material-dashboard-pro/pages/dashboards/analytics
116 stars 28 forks source link

TypeError: $(...).perfectScrollbar is not a function #270

Closed zellers closed 4 years ago

zellers commented 4 years ago

Prerequisites

Please answer the following questions for yourself before submitting an issue.

Expected Behavior

This applies to my project but also to the Demo @ https://demos.creative-tim.com/material-dashboard-pro/examples/dashboard.html

On Windows: minimizeSidebar button should minimize the Sidebar.

Current Behavior

On Windows: minimizeSidebar button does not minimize the Sidebar. Console shows: TypeError: $(...).perfectScrollbar is not a function

Failure Information (for bugs)

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Goto https://demos.creative-tim.com/material-dashboard-pro/examples/dashboard.html ON WINDOWS.
  2. Click the minimizeSidebar button
  3. Check console in developer tools. See error TypeError: $(...).perfectScrollbar is not a function

Context

Failure Logs

TypeError: $(...).perfectScrollbar is not a function

groovemen commented 4 years ago

Hello there,

Thank you for using our products and for letting us know about this issue. Until we fix this into the next update, we will ask you to make the following changes:

go to assets/js/material-dashboard.js and delete function from line 18 to 29 paste this function instead: (function() { isWindows = navigator.platform.indexOf('Win') > -1 ? true : false;

if (isWindows) { // if we are on windows OS we activate the perfectScrollbar function var ps = new PerfectScrollbar('.sidebar'); var ps1 = new PerfectScrollbar('.sidebar-wrapper'); var ps2 = new PerfectScrollbar('.main-panel'); var ps3 = new PerfectScrollbar('.main'); $('html').addClass('perfect-scrollbar-on');

} else { $('html').addClass('perfect-scrollbar-off'); } })(); Sorry for this inconvenience and hope this information helps you. Please let us know if we can help you with anything else.

All the best, Stefan