You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We recently noticed that upgrading to v5.7 of the framework breaks the scrollTo functionality in this plugin. From my understanding, the target of scrollTo() must now be an Adapt object.
The following changes to the click event listener seem to work in v5.6 and v5.7 (haven't tested anything older):
onScrollPromptClick: function(event) {
/* set scroll to selector depending on model type */
switch (this.model.get('_type')) {
case 'course':
var nextCO = this.model.findDescendantModels('contentObject')[0].attributes._id;
Adapt.scrollTo('.' + nextCO, { duration: 800 });
break;
case 'page':
var nextArticle = this.model.findDescendantModels('article')[0].attributes._id;
Adapt.scrollTo('.' + nextArticle, { duration: 800 });
break;
case 'component':
var nextBlock = this.model.findRelativeModel('@block +1').attributes._id;
Adapt.scrollTo('.' + nextBlock, { duration: 800 });
break;
}
However, I'm unsure if there's a cleaner way to do this? Also, for menus, this would scroll to the first contentObject menu item. So, it would assume that the first contentObject is the topmost menu item that you would logically want to scroll to.
Worth mentioning that the addition of the 'component' type here is dependent on PR #4 .
The text was updated successfully, but these errors were encountered:
We recently noticed that upgrading to v5.7 of the framework breaks the scrollTo functionality in this plugin. From my understanding, the target of scrollTo() must now be an Adapt object.
The following changes to the click event listener seem to work in v5.6 and v5.7 (haven't tested anything older):
However, I'm unsure if there's a cleaner way to do this? Also, for menus, this would scroll to the first contentObject menu item. So, it would assume that the first contentObject is the topmost menu item that you would logically want to scroll to.
Worth mentioning that the addition of the 'component' type here is dependent on PR #4 .
The text was updated successfully, but these errors were encountered: