Picture of Chris Gillison
glossary items not opening
by Chris Gillison - Wednesday, 4 April 2018, 11:14 AM
 

Hi all,

Using the adapt-contrib-glossary in previous courses I've developed, if I put a link to a glossary item in the content and clicked it, the following would happen:

  1. the drawer would open at the glossary
  2. the selected glossary term would be highlighted
  3. the term's description would be expanded

Now it seems 1 & 2 still happen, but 3 doesn't. And because the term is highlighted, you have to click on it twice to expand the description.

This issue causes further trouble for me as I have long glossaries that scroll. I've been using the following code in adapt-contrib-glossaryItemView.js here to 'auto-scroll' the glossary if the description is off the bottom of the screen:

showGlossaryItemDescription: function() {
  var $glossaryItemTerm = this.$('.glossary-item-term');
  var $description = $glossaryItemTerm.addClass('selected').siblings('.glossary-item-description');
  $description.slideDown(400, _.bind(function() {
    this.$el.parents('.drawer').scrollTo($glossaryItemTerm, 1000);
    $description.a11y_focus();
  }, this));
  $glossaryItemTerm.attr('aria-expanded', false);
  this.model.set('_isDescriptionOpen', true);
},

This works fine if you're just browsing the glossary, but if you've arrived there from a link in the content it doesn't work at all, presumably becuse showGlossaryItemDescription() isn't getting called. The end result is you click the link, the glossary drawer opens, and nothing else, because the (unexpanded) selected term is off the bottom of the screen.

Please could someone help with this? I think if the description expanding issue is fixed the second problem will be fixed too.

Many thanks in advance. Chris

Picture of Matt Leathes
Re: glossary items not opening
by Matt Leathes - Wednesday, 4 April 2018, 2:55 PM
 

Hi Chris

Are you using v3.0.0 of the framework? If so, I think the update from JQuery v2.2.3 to v3.3.1 has broken this - at least if I change back to using JQuery v2.2.3 it all starts working again.

Not quite sure why this is I'm afraid. TBH might be better at this point to change to CSS animation for the 'slide description open' effect... I'll see if anyone's got time to look at this.

Picture of Chris Gillison
Re: glossary items not opening
by Chris Gillison - Wednesday, 4 April 2018, 4:37 PM
 

Thanks Matt,

I guess I am using v3 of the framework - in that I created a course today to test if it was working 'straight out of the box' (i.e. it wasn't some code I'd tweaked and forgotten about that was messing things up!).

Would it automattically be v3 if I ran adapt create course today?

Picture of Matt Leathes
Re: glossary items not opening
by Matt Leathes - Wednesday, 4 April 2018, 5:27 PM
 
Would it automatically be v3 if I ran adapt create course today?

Yes, that's right. If you want to get the older version (the one that's compatible with IE8/9/10) there are instructions for doing so here.

If you ever need to check which version of the framework you're using - look in package.json

You could do a 'quick fix' on the course you have already downloaded by simply changing it back to the older version of JQuery. To do that, save this file into your v3 course as src/core/js/libraries/jquery.min.js i.e. overwriting the version that's in there already. Then run $ grunt dev or $ grunt build.

Picture of Chris Gillison
Re: glossary items not opening
by Chris Gillison - Friday, 6 April 2018, 3:29 PM
 

Thanks Matt. The quick fix worked perfectly.