Some JS errors are occurring when the module is first installed.
GET http://local.d8-sandbox.com/sites/all/libraries/jquery.tocify.js/src/javascripts/jquery.tocify.js?v=1.9.0 404 (Not Found)
drupal.js?v=8.1.1:67 Uncaught TypeError: $(...).tocify is not a function
Looks like the js library is referencing the path:
/sites/all/libraries/jquery.tocify.js/src/javascripts/jquery.tocify.js: {}
I think this needs to be
tocify/jquery.tocify.js: {}
With the jquery.tocify.js file added to the module.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | tocify-include-tocify-js-2738633-10.patch | 3.37 KB | sanduhrs |
| #9 | tocify-include-tocify-js-2738633-9.patch | 2.57 KB | andrew_tspkh |
| #6 | tocify-include-tocify-js-2738633-2-8.x-1.x-dev.patch | 35.7 KB | Xtal |
Comments
Comment #2
Xtal commentedComment #3
Xtal commentedComment #4
Xtal commentedComment #5
Xtal commentedComment #6
Xtal commentedIncorrect js in patch.
Comment #7
sanduhrsI'd prefer to not have the tocify.js in the module.
Same goes for the D7 version of the module.
A more welcome solution would be to
* have hook_requirements implemented and warn the user of the requirement
* have a drush command to download the library (drush dl-tocify)
How far is libraries module in regard to external js libraries btw?
Comment #8
sanduhrsComment #9
andrew_tspkhHi there!
I've fixed this problem. The patch is attached.
Review, please.
Comment #10
sanduhrsThanks for your contribution!
* Adjusted the README a bit
* Removed the Tocify default styles, as they break the theme
* Switched to the new array syntax
New patch attached.
Comment #11
sanduhrsChanged the title a bit.
Comment #13
sanduhrsReleased, thanks!
Comment #14
sanduhrs