lemoynelibrary / lemoyne

Files used in setting up new web design in LibGuides v2 and elsewhere
5 stars 1 forks source link

Dropdown menu not working on A-Z list #31

Closed tomkeays closed 6 years ago

tomkeays commented 6 years ago

Here's my email to SpringShare Support (2018-04-10). I'll update this issue with a comment when it is resolved.

On most of our LibGuides pages, the LibGuides system (i.e., SpringShare-generated) is serving up some custom JavaScript that purposely omits Bootstrap JavaScript code.

<script type="text/javascript" src="/web/js1.23.9/lg-public-no-bs.min.js"></script>

Because our site uses dropdown menus in the <nav> section, I therefore have to call Bootstrap JavaScript to make the menus work. I've put this call to the Bootstrap CDN in the Custom JS/CSS module in LibGuides Admin.

<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

However, on the A-Z Databases page, LibGuides is serving a different JavaScript file than the other LibGuides pages, one which does contain Bootstrap v3.3.4 JavaScript code.

<script type="text/javascript" src="/web/js1.23.9/lg-public.min.js"></script>

The problem for us is that this causes the A-Z Database page to have two calls to Bootstrap JavaScript. As a consequence, the dropdown menus in <nav> are broken for just the A-Z Database page.

In addition, I can't find a way to remove my Bootstrap JavaScript on just the A-Z Databases page. I also don't have a way to use a custom <nav> that doesn't use dropdowns. (I can do both of those in LibGuides Groups, but not for the A-Z Database... apparently. Please advise me if I'm missing it.)

What should I be doing?

Note: Just in case there was a conflict between the v3.3.7 JavaScript that I'm serving and the v3.3.4 that you are serving, I tried revising my call to use the v3.3.4 version in the CDN. That didn't fix it. I think the problem is the duplicate calls.

<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>

tomkeays commented 6 years ago

Reply from SpringShare on April 10

I'm really sorry for the inconvenience with this! I'll definitely let our LibGuides team know about this. I suspect this would require a code update on our end to change, so I'm not sure how quickly that could be resolved. :(

In the meantime, though, I do have a question for you: in your email, you mentioned that you're loading your own Bootstrap files because LibGuides was omitting them. Just to clarify: did you intentionally disable Bootstrap for your LibGuides system? There is an option to exclude it, which is why I ask.

If you're actually able to use the versions of Bootstrap (3.3.4) and jQuery (1.12.1) that LibGuides loads by default, then I would recommend removing your own script includes and deselecting the "Do not include Bootstrap JavaScript and CSS includes on public pages" option under Admin > Look & Feel > Custom JS/CSS. (I would imagine that 3.3.4 would support the dropdowns you are using, but you may need to try it to be sure.)

I hope this helps! Please let us know if you have any other questions.

tomkeays commented 6 years ago

Reply from SpringShare on May 1

Just a quick note to let you know that we're going to fix this with our next code release, which will be coming mid-May. After the code release, the AZ page will operate the same way as other public pages when you disable bootstrap from system settings.

Thanks for bringing this to our attention; it was an oversight on our part.

tomkeays commented 6 years ago

Tested the page today and the problem is fixed.