diff --git a/builds/4chan-X.js b/builds/4chan-X.js index 2c94676e7..cc36717b5 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -2113,6 +2113,8 @@ dy: e.clientY - rect.top, height: screenHeight - rect.height, width: screenWidth - rect.width, + topBorder: Conf["Bottom Header"] ? 0 : Header.bar.getBoundingClientRect().height, + bottomBorder: Conf["Bottom Header"] ? Header.bar.getBoundingClientRect().height : 0, screenHeight: screenHeight, screenWidth: screenWidth, isTouching: isTouching @@ -2149,9 +2151,9 @@ left = clientX - this.dx; left = left < 10 ? 0 : this.width - left < 10 ? null : left / this.screenWidth * 100 + '%'; top = clientY - this.dy; - top = top < 10 ? 0 : this.height - top < 10 ? null : top / this.screenHeight * 100 + '%'; + top = top < (10 + this.topBorder) ? this.topBorder + 'px' : this.height - top < (10 + this.bottomBorder) ? null : top / this.screenHeight * 100 + '%'; right = left === null ? 0 : null; - bottom = top === null ? 0 : null; + bottom = top === null ? this.bottomBorder + 'px' : null; style = this.style; style.left = left; style.right = right; diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index cf91966ee..39bdef7a7 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -2109,6 +2109,8 @@ dy: e.clientY - rect.top, height: screenHeight - rect.height, width: screenWidth - rect.width, + topBorder: Conf["Bottom Header"] ? 0 : Header.bar.getBoundingClientRect().height, + bottomBorder: Conf["Bottom Header"] ? Header.bar.getBoundingClientRect().height : 0, screenHeight: screenHeight, screenWidth: screenWidth, isTouching: isTouching @@ -2145,9 +2147,9 @@ left = clientX - this.dx; left = left < 10 ? 0 : this.width - left < 10 ? null : left / this.screenWidth * 100 + '%'; top = clientY - this.dy; - top = top < 10 ? 0 : this.height - top < 10 ? null : top / this.screenHeight * 100 + '%'; + top = top < (10 + this.topBorder) ? this.topBorder + 'px' : this.height - top < (10 + this.bottomBorder) ? null : top / this.screenHeight * 100 + '%'; right = left === null ? 0 : null; - bottom = top === null ? 0 : null; + bottom = top === null ? this.bottomBorder + 'px' : null; style = this.style; style.left = left; style.right = right; diff --git a/builds/crx/script.js b/builds/crx/script.js index 548aec8cc..bad35abf9 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -2022,6 +2022,8 @@ dy: e.clientY - rect.top, height: screenHeight - rect.height, width: screenWidth - rect.width, + topBorder: Conf["Bottom Header"] ? 0 : Header.bar.getBoundingClientRect().height, + bottomBorder: Conf["Bottom Header"] ? Header.bar.getBoundingClientRect().height : 0, screenHeight: screenHeight, screenWidth: screenWidth, isTouching: isTouching @@ -2058,9 +2060,9 @@ left = clientX - this.dx; left = left < 10 ? 0 : this.width - left < 10 ? null : left / this.screenWidth * 100 + '%'; top = clientY - this.dy; - top = top < 10 ? 0 : this.height - top < 10 ? null : top / this.screenHeight * 100 + '%'; + top = top < (10 + this.topBorder) ? this.topBorder + 'px' : this.height - top < (10 + this.bottomBorder) ? null : top / this.screenHeight * 100 + '%'; right = left === null ? 0 : null; - bottom = top === null ? 0 : null; + bottom = top === null ? this.bottomBorder + 'px' : null; style = this.style; style.left = left; style.right = right; diff --git a/src/General/UI.coffee b/src/General/UI.coffee index b2fff3393..aa4ef9f5f 100644 --- a/src/General/UI.coffee +++ b/src/General/UI.coffee @@ -222,6 +222,8 @@ UI = do -> dy: e.clientY - rect.top height: screenHeight - rect.height width: screenWidth - rect.width + topBorder: if Conf["Bottom Header"] then 0 else Header.bar.getBoundingClientRect().height + bottomBorder: if Conf["Bottom Header"] then Header.bar.getBoundingClientRect().height else 0 screenHeight: screenHeight screenWidth: screenWidth isTouching: isTouching @@ -254,9 +256,9 @@ UI = do -> left / @screenWidth * 100 + '%' top = clientY - @dy - top = if top < 10 - 0 - else if @height - top < 10 + top = if top < (10 + @topBorder) + @topBorder + 'px' + else if @height - top < (10 + @bottomBorder) null else top / @screenHeight * 100 + '%' @@ -265,8 +267,9 @@ UI = do -> 0 else null + bottom = if top is null - 0 + @bottomBorder + 'px' else null