Skip to content

Commit

Permalink
this.video.clientWidth > this.container.clientWidth
Browse files Browse the repository at this point in the history
  • Loading branch information
SashaXser committed Jun 18, 2024
1 parent e3e17fc commit 27c8aad
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion dist/vot-cloudflare-min.user.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/vot-cloudflare.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -5494,11 +5494,11 @@ class VideoHandler {
if (this.dragging) {
e.preventDefault();

const percentX = (e.clientX / this.video.clientWidth) * 100;
const percentX = (e.clientX / this.container.clientWidth) * 100;
// const percentY = (e.clientY / this.video.clientHeight) * 100;

this.data.buttonPos =
this.video.clientWidth && this.video.clientWidth > 550
this.container.clientWidth && this.container.clientWidth > 550
? percentX <= 33
? "left"
: percentX >= 66
Expand All @@ -5509,7 +5509,7 @@ class VideoHandler {
this.data.buttonPos === "default" ? "row" : "column";
this.votButton.container.dataset.position = this.data.buttonPos;
this.votMenu.container.dataset.position = this.data.buttonPos;
if (this.video.clientWidth && this.video.clientWidth > 550) {
if (this.container.clientWidth && this.container.clientWidth > 550) {
await storage/* votStorage */.d.set("buttonPos", this.data.buttonPos);
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/vot-min.user.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/vot.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -5384,11 +5384,11 @@ class VideoHandler {
if (this.dragging) {
e.preventDefault();

const percentX = (e.clientX / this.video.clientWidth) * 100;
const percentX = (e.clientX / this.container.clientWidth) * 100;
// const percentY = (e.clientY / this.video.clientHeight) * 100;

this.data.buttonPos =
this.video.clientWidth && this.video.clientWidth > 550
this.container.clientWidth && this.container.clientWidth > 550
? percentX <= 33
? "left"
: percentX >= 66
Expand All @@ -5399,7 +5399,7 @@ class VideoHandler {
this.data.buttonPos === "default" ? "row" : "column";
this.votButton.container.dataset.position = this.data.buttonPos;
this.votMenu.container.dataset.position = this.data.buttonPos;
if (this.video.clientWidth && this.video.clientWidth > 550) {
if (this.container.clientWidth && this.container.clientWidth > 550) {
await votStorage.set("buttonPos", this.data.buttonPos);
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -912,11 +912,11 @@ class VideoHandler {
if (this.dragging) {
e.preventDefault();

const percentX = (e.clientX / this.video.clientWidth) * 100;
const percentX = (e.clientX / this.container.clientWidth) * 100;
// const percentY = (e.clientY / this.video.clientHeight) * 100;

this.data.buttonPos =
this.video.clientWidth && this.video.clientWidth > 550
this.container.clientWidth && this.container.clientWidth > 550
? percentX <= 33
? "left"
: percentX >= 66
Expand All @@ -927,7 +927,7 @@ class VideoHandler {
this.data.buttonPos === "default" ? "row" : "column";
this.votButton.container.dataset.position = this.data.buttonPos;
this.votMenu.container.dataset.position = this.data.buttonPos;
if (this.video.clientWidth && this.video.clientWidth > 550) {
if (this.container.clientWidth && this.container.clientWidth > 550) {
await votStorage.set("buttonPos", this.data.buttonPos);
}
}
Expand Down

0 comments on commit 27c8aad

Please sign in to comment.