Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] $(...).perfectScrollbar is not a function TypeError #51

Open
sknoops opened this issue May 25, 2021 · 5 comments
Open

[Bug] $(...).perfectScrollbar is not a function TypeError #51

sknoops opened this issue May 25, 2021 · 5 comments

Comments

@sknoops
Copy link

sknoops commented May 25, 2021

Version

Paper Dashboard PRO - V1.3.1

Reproduction link

https://demos.creative-tim.com/paper-dashboard-pro/examples/forms/extended.html

Operating System

Windows 10

Device

PC

Browser & Version

Chrome, latest

Steps to reproduce

Open the 'extended.html' page in the examples of paper-dashboard-pro-v1.3.1
Watch the console in Chrome
See error mentioned in title

What is expected?

No error should be exptected in the console when opening this example

What is actually happening?

Error is produced, saying perfectScrollbar is not a function


Solution

Did not find any solution yet, please help me find one.

Additional comments

Thanks for the nice work you did, I really like the template. But I need to get it to work without errors, so thank you in advance for your swift response and help with this.
Best regards, Steffen

@facundoruiz
Copy link

Comenta el codigo del archivo paper-dashboard.js


// (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');

//     } else {
//         $('html').addClass('perfect-scrollbar-off');
//     }
// })();

y agrega esto luego del $(document).ready



    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');
    }

@sknoops
Copy link
Author

sknoops commented Jun 2, 2021

Hmmmm, does not seem to help @facundoruiz ... still same error.

image

@facundoruiz
Copy link

facundoruiz commented Jun 2, 2021

Hola, si tienes razón, mi culpa.
yo estoy usando paper-dashboard-2 versión free
https://www.creative-tim.com/product/paper-dashboard-2
y ahí se usa el plugin perfect-scrollbar v0.6.13
y la versión paper-dashboard-2-Pro plugin perfect-scrollbar v1.4.0
quizás cambiando de versión el plugin tu proyecto funcione!

PD: Fui a leer el
https://demos.creative-tim.com/paper-dashboard-pro/assets/js/paper-dashboard.js
busca la linea 123

if (isWindows) {
        $('.bootstrap-select .dropdown-menu .inner').perfectScrollbar();
      }

comenta o borrar esa esa linea
Ahi creo que esta el problema en la version PRO.

@sknoops
Copy link
Author

sknoops commented Jun 2, 2021

Muchas gracias @facundoruiz !
This is working. :-)
So the creator of the dashboard should also use the old version, or they should make their javascript compatible with the v1.4.0.
Best regards, Steffen

@sknoops
Copy link
Author

sknoops commented Jun 2, 2021

And indeed, if I comment out the line you mentioned, but I found it on line 95, I can run the script with v1.4.0.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants