mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +02:00
Add margin to left and right side of users.js
This commit is contained in:
parent
284b458148
commit
5dab2ac2a7
1 changed files with 6 additions and 1 deletions
|
@ -253,6 +253,11 @@ var usersWindow = (function () {
|
|||
windowPane,
|
||||
windowHeading,
|
||||
|
||||
// Margin on the left and right side of the window to keep
|
||||
// it from getting too close to the edge of the screen which
|
||||
// is unclickable.
|
||||
WINDOW_MARGIN_X = 20,
|
||||
|
||||
// Window border is similar to that of edit.js.
|
||||
WINDOW_MARGIN_HALF = WINDOW_MARGIN / 2,
|
||||
WINDOW_BORDER_WIDTH = WINDOW_WIDTH + 2 * WINDOW_MARGIN_HALF,
|
||||
|
@ -446,7 +451,7 @@ var usersWindow = (function () {
|
|||
}
|
||||
|
||||
function saturateWindowPosition() {
|
||||
windowPosition.x = Math.max(0, Math.min(viewport.x - WINDOW_WIDTH, windowPosition.x));
|
||||
windowPosition.x = Math.max(WINDOW_MARGIN_X, Math.min(viewport.x - WINDOW_WIDTH - WINDOW_MARGIN_X, windowPosition.x));
|
||||
windowPosition.y = Math.max(windowMinimumHeight, Math.min(viewport.y, windowPosition.y));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue