gwu-libraries / obento

Bento Box style search results page
MIT License
8 stars 1 forks source link

Database descriptions' "more" and "less" links stopped working in Production #386

Closed kerchner closed 8 years ago

kerchner commented 8 years ago

Not sure why this stopped working on 12-May-2016. Clicking on "more" and "less" links resulted in Javascript error on the console referencing onclick and $ is not a function. Haven't been able to reproduce this in the test instance. Suspect that something have changed with JQuery deployment in the Drupal environment on production.

Fixed this by "dumbing down" the JQuery code (in https://github.com/gwu-libraries/obento/blob/master/obi/ui/templates/databases.html#L46 and https://github.com/gwu-libraries/obento/blob/master/obi/ui/templates/databases.html#L51) into the equivalent Javascript:

onclick="document.getElementById('partialdescriptioni{{ forloop.counter }}').style='display:none';document.getElementById('completedescription{{ forloop.counter }}').style='display:visible';"

onclick="document.getElementById('partialdescriptioni{{ forloop.counter }}').style='display:visible';document.getElementById('completedescription{{ forloop.counter }}').style='display:none';"

respectively.

There may be further ways this code can be simplified.