Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JW8-2607] Keep controls visible is activated via keyboard #3259

Merged
merged 3 commits into from Jan 23, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/js/view/controls/controls.js
Expand Up @@ -33,7 +33,6 @@ instances.forEach(api => {
const reasonInteraction = function() {
return { reason: 'interaction' };
};

export default class Controls {
constructor(context, playerContainer) {
Object.assign(this, Events);
Expand Down Expand Up @@ -71,8 +70,18 @@ export default class Controls {
this.activeTimeout = setTimeout(this.userInactiveTimeout, remainingTime);
return;
}
if (this.playerContainer.querySelector('.jw-tab-focus')) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DanFerrer why do we need this ? We already set the activeTimeout to 0 when tabbing inside the player

// keep controls active when navigating inside the player

this.resetActiveTimeout();
return;
}
this.userInactive();
};
this.resetActiveTimeout = () => {
DanFerrer marked this conversation as resolved.
Show resolved Hide resolved
console.log('im hit', this);
clearTimeout(this.activeTimeout);
this.activeTimeout = -1;
this.inactiveTime = 0;
};
}

enable(api, model) {
Expand Down Expand Up @@ -474,9 +483,7 @@ export default class Controls {
this.activeTimeout = setTimeout(this.userInactiveTimeout, timeout);
}
} else {
clearTimeout(this.activeTimeout);
this.activeTimeout = -1;
this.inactiveTime = 0;
this.resetActiveTimeout();
}
if (!this.showing) {
removeClass(this.playerContainer, 'jw-flag-user-inactive');
Expand Down