Index: include.postload.js |
=================================================================== |
--- a/include.postload.js |
+++ b/include.postload.js |
@@ -700,8 +700,12 @@ |
case "clickhide-move": |
if (clickHideFiltersDialog) |
{ |
- clickHideFiltersDialog.style.left = (parseInt(clickHideFiltersDialog.style.left, 10) + msg.x) + "px"; |
- clickHideFiltersDialog.style.top = (parseInt(clickHideFiltersDialog.style.top, 10) + msg.y) + "px"; |
+ var rect = clickHideFiltersDialog.getBoundingClientRect(); |
+ var x = Math.max(0, Math.min(rect.left + msg.x, window.innerWidth - rect.width)); |
+ var y = Math.max(0, Math.min(rect.top + msg.y, window.innerHeight - rect.height)); |
+ |
+ clickHideFiltersDialog.style.left = x + "px"; |
+ clickHideFiltersDialog.style.top = y + "px"; |
} |
break; |
case "clickhide-close": |