From 894e85c005fde5f2d79d85921b33d51c368100e3 Mon Sep 17 00:00:00 2001 From: facundo Date: Wed, 2 Jun 2021 02:24:53 -0300 Subject: [PATCH] Soluciona el error PerfectScrollbar Uncaught ReferenceError: PerfectScrollbar is not defined perfectScrollbar funciona con jquery hay que llamarlo de esa forma no instanciarlo --- assets/js/paper-dashboard.js | 42 +++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/assets/js/paper-dashboard.js b/assets/js/paper-dashboard.js index 06df714..e1a8b48 100644 --- a/assets/js/paper-dashboard.js +++ b/assets/js/paper-dashboard.js @@ -15,20 +15,20 @@ */ -(function() { - isWindows = navigator.platform.indexOf('Win') > -1 ? true : false; +// (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'); - $('html').addClass('perfect-scrollbar-on'); +// 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'); +// $('html').addClass('perfect-scrollbar-on'); - } else { - $('html').addClass('perfect-scrollbar-off'); - } -})(); +// } else { +// $('html').addClass('perfect-scrollbar-off'); +// } +// })(); transparent = true; transparentDemo = true; @@ -43,6 +43,22 @@ seq = 0, delays = 80, durations = 500; seq2 = 0, delays2 = 80, durations2 = 500; $(document).ready(function() { + + isWindows = navigator.platform.indexOf('Win') > -1 ? true : false; + + if (isWindows) { + // if we are on windows OS we activate the perfectScrollbar function + $('.sidebar').perfectScrollbar(); + $('.sidebar-wrapper').perfectScrollbar(); + $('.main-panel').perfectScrollbar(); + + $('html').addClass('perfect-scrollbar-on'); + + } else { + $('html').addClass('perfect-scrollbar-off'); + } + + if ($('.full-screen-map').length == 0 && $('.bd-docs').length == 0) { // On click navbar-collapse the menu will be white not transparent @@ -195,4 +211,4 @@ function hexToRGB(hex, alpha) { } else { return "rgb(" + r + ", " + g + ", " + b + ")"; } -} \ No newline at end of file +}