0
votes

I have a custom script.js in my drupal theme. One of it's functions is to toggle a class on the offcanvas navigation when a button is clicked. It works perfectly on all pages of the site...apart from those at:

  • /user/login
  • /user/pass
  • /user/register
  • /user when not logged in (which has the same form therefore as user/login).

/user when logged in (profile page) and user profiles at their proper urls (eg. /user/1) work perfectly fine.

I don't have separate page templates for the pages that aren't working. I do however have templates for the forms on each of those pages (login, register, password request) that were done using this method. It feels like that's relevant even though they are templates for the form and not the actual page.

The script js is loading fine and it's not throwing any errors.

Example of it working: http://charityapprentice.org/ (and all other pages you can browse) Example of it not working: http://charityapprentice.org/user/login

1

1 Answers

0
votes

The script is not working because of javascript error in /user/* pages.

Error

Uncaught TypeError: Cannot read property 'remove' of undefined

File (line #38)

sites/all/modules/label_trash/js/label_trash.js