Skip to content

Commit

Permalink
Disable scrolling while in full window video mode
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickmaher committed Jul 21, 2018
1 parent b288fcc commit ad102e3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Enhanced RT.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ ready('.vjs-fullscreen-control', function(element) {
event.target.className = "icon-compress-alt";
event.target.title = "Non-Full Window";

// Disable scroll while in full window
document.getElementsByTagName("body")[0].style.overflow = "hidden";

var videoElement = document.getElementsByTagName("video")[0];

videoElement.parentNode.parentNode.style.width = "100vw";
Expand Down Expand Up @@ -174,6 +177,9 @@ ready('.vjs-fullscreen-control', function(element) {
event.target.className = "icon-expand-alt";
event.target.title = "Full Window";

// Re-enable scroll
document.getElementsByTagName("body")[0].style.overflow = "visible";

var videoElement = document.getElementsByTagName("video")[0];

videoElement.parentNode.parentNode.style.width = "";
Expand Down

0 comments on commit ad102e3

Please sign in to comment.