Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

jquery dependency for GraphPie.js #25

Open
mikeslim7 opened this issue Dec 19, 2013 · 2 comments
Open

jquery dependency for GraphPie.js #25

mikeslim7 opened this issue Dec 19, 2013 · 2 comments

Comments

@mikeslim7
Copy link

I kept having a GraphPie related problem when i click on the Home button from another view. The problem was coming from:

GraphPie.js

...e=(b.parent().width()-2*d)/2...

and the error log in the console would be:
"...b.parent(...).width() is not a function..."

I think this is because the js is executed before jquery is loaded, especially if you are moving to the Home view from another view (It's not the first loading of the page).

I resolved the issue by modifying the header.ctp file to include jquery:

...
<link href="css/highlightjs/zenburn.css" rel="stylesheet" type="text/css">
        <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
        <script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
    </head>
...

I think it would be better to implement this in future releases. So jquery is always available. Or find a way to ensure that angular.js will always load jquery before running a function that needs it.

Thanks!

Regards,
Mike.

@wa0x6e
Copy link
Owner

wa0x6e commented Dec 22, 2013

Jquery is a dependency in Angular.js modules, so it "should" load before. Maybe there's something missing in the dependency in Require.js

@paco3346
Copy link

paco3346 commented Dec 5, 2014

Maybe related to #38 as well? I couldn't cause this issue but it would make sense given that the fix is to add jQuery as a dependency for angular.

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

No branches or pull requests

3 participants