Skip to content
This repository has been archived by the owner on Jun 28, 2019. It is now read-only.

Commit

Permalink
Merge pull request #63 from ryan-nauman/feature/focus-highlight
Browse files Browse the repository at this point in the history
scroll highlighted track into view
  • Loading branch information
matt-h committed Oct 19, 2015
2 parents 7c5fd22 + d5a4b12 commit 9a51bea
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions rdio-enhancer.ts
Expand Up @@ -830,6 +830,26 @@ function injectedJs() {
};
}

if(a == "Catalog2014.Album") {
b.orig_onInserted = b.onInserted;
b.onInserted = function() {
b.orig_onInserted.call(this);
this.trigger('Catalog2014.Album:inserted');
}
}

if(a == "TrackList") {
b.orig_onRendered = b.onRendered;
b.onRendered = function() {
b.orig_onRendered.call(this);
if (this.options.highlightTrack && this.parent() instanceof R.Components.Catalog2014.Album) {
this.listen(this.parent(), "Catalog2014.Album:inserted", () => {
this.$('.url_highlighted a').focus();
});
}
}
}

return R.Component.orig_create.call(this, a,b,c);
};
},
Expand Down

0 comments on commit 9a51bea

Please sign in to comment.