Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshMoreno committed Feb 24, 2020
1 parent 27b0bbf commit 36cbe9a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
20 changes: 10 additions & 10 deletions build/ableplayer.dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -2248,16 +2248,16 @@ var AblePlayerInstances = [];

// tabbable transcript
if (this.prefTabbable === 1) {
$('.able-transcript span.able-transcript-seekpoint').attr('tabindex','0');
this.$transcriptDiv.find('span.able-transcript-seekpoint').attr('tabindex','0');
}
else {
$('.able-transcript span.able-transcript-seekpoint').removeAttr('tabindex');
this.$transcriptDiv.find('span.able-transcript-seekpoint').removeAttr('tabindex');
}

// transcript highlights
if (this.prefHighlight === 0) {
// user doesn't want highlights; remove any existing highlights
$('.able-transcript span').removeClass('able-highlight');
this.$transcriptDiv.find('span').removeClass('able-highlight');
}

// Re-initialize caption and description in case relevant settings have changed
Expand Down Expand Up @@ -8531,19 +8531,19 @@ if (thisObj.useTtml && (trackSrc.endsWith('.xml') || trackText.startsWith('<?xml

// If transcript locked, scroll transcript to current highlight location.
if (this.autoScrollTranscript && this.currentHighlight) {
newTop = Math.floor($('.able-transcript').scrollTop() +
newTop = Math.floor(this.$transcriptDiv.scrollTop() +
$(this.currentHighlight).position().top -
($('.able-transcript').height() / 2) +
(this.$transcriptDiv.height() / 2) +
($(this.currentHighlight).height() / 2));
if (newTop !== Math.floor($('.able-transcript').scrollTop())) {
if (newTop !== Math.floor(this.$transcriptDiv.scrollTop())) {
// Set a flag to ignore the coming scroll event.
// there's no other way I know of to differentiate programmatic and user-initiated scroll events.
this.scrollingTranscript = true;
// only scroll once after moving a highlight
if (this.movingHighlight) {
$('.able-transcript').scrollTop(newTop);
this.movingHighlight = false;
}
this.$transcriptDiv.scrollTop(newTop);
this.movingHighlight = false;
}
}
}
}
Expand Down Expand Up @@ -10767,7 +10767,7 @@ if (thisObj.useTtml && (trackSrc.endsWith('.xml') || trackText.startsWith('<?xml

// Make transcript tabbable if preference is turned on.
if (this.prefTabbable === 1) {
$('.able-transcript span.able-transcript-seekpoint').attr('tabindex','0');
this.$transcriptDiv.find('span.able-transcript-seekpoint').attr('tabindex','0');
}

// handle clicks on text within transcript
Expand Down
20 changes: 10 additions & 10 deletions build/ableplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2248,16 +2248,16 @@ var AblePlayerInstances = [];

// tabbable transcript
if (this.prefTabbable === 1) {
$('.able-transcript span.able-transcript-seekpoint').attr('tabindex','0');
this.$transcriptDiv.find('span.able-transcript-seekpoint').attr('tabindex','0');
}
else {
$('.able-transcript span.able-transcript-seekpoint').removeAttr('tabindex');
this.$transcriptDiv.find('span.able-transcript-seekpoint').removeAttr('tabindex');
}

// transcript highlights
if (this.prefHighlight === 0) {
// user doesn't want highlights; remove any existing highlights
$('.able-transcript span').removeClass('able-highlight');
this.$transcriptDiv.find('span').removeClass('able-highlight');
}

// Re-initialize caption and description in case relevant settings have changed
Expand Down Expand Up @@ -8531,19 +8531,19 @@ if (thisObj.useTtml && (trackSrc.endsWith('.xml') || trackText.startsWith('<?xml

// If transcript locked, scroll transcript to current highlight location.
if (this.autoScrollTranscript && this.currentHighlight) {
newTop = Math.floor($('.able-transcript').scrollTop() +
newTop = Math.floor(this.$transcriptDiv.scrollTop() +
$(this.currentHighlight).position().top -
($('.able-transcript').height() / 2) +
(this.$transcriptDiv.height() / 2) +
($(this.currentHighlight).height() / 2));
if (newTop !== Math.floor($('.able-transcript').scrollTop())) {
if (newTop !== Math.floor(this.$transcriptDiv.scrollTop())) {
// Set a flag to ignore the coming scroll event.
// there's no other way I know of to differentiate programmatic and user-initiated scroll events.
this.scrollingTranscript = true;
// only scroll once after moving a highlight
if (this.movingHighlight) {
$('.able-transcript').scrollTop(newTop);
this.movingHighlight = false;
}
this.$transcriptDiv.scrollTop(newTop);
this.movingHighlight = false;
}
}
}
}
Expand Down Expand Up @@ -10767,7 +10767,7 @@ if (thisObj.useTtml && (trackSrc.endsWith('.xml') || trackText.startsWith('<?xml

// Make transcript tabbable if preference is turned on.
if (this.prefTabbable === 1) {
$('.able-transcript span.able-transcript-seekpoint').attr('tabindex','0');
this.$transcriptDiv.find('span.able-transcript-seekpoint').attr('tabindex','0');
}

// handle clicks on text within transcript
Expand Down
2 changes: 1 addition & 1 deletion build/ableplayer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 36cbe9a

Please sign in to comment.