Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElshad Seyidmammadov2016-04-22 09:21:35 -0400
committerGerrit Code Review @ Eclipse.org2016-04-25 06:10:35 -0400
commitab44320c07452d897020fd1e8b71923db6d2fb2e (patch)
tree5210dc81c65b63e4cbe8e3a3d21dacdab8c6adec /bundles
parentf444a3a2771a3e5cf3f6d1539f998127c61d0992 (diff)
downloadorg.eclipse.rap-ab44320c07452d897020fd1e8b71923db6d2fb2e.tar.gz
org.eclipse.rap-ab44320c07452d897020fd1e8b71923db6d2fb2e.tar.xz
org.eclipse.rap-ab44320c07452d897020fd1e8b71923db6d2fb2e.zip
Adjust shell drag offset
When website-like scrolling is enabled and there is a scroll offset, dragging shell is shifted from the mouse pointer. To avoid the shifting, took scroll offset into account while shell position is calculated. Change-Id: Ie66d13f8d2e539a4616b90125b814536231b5a3a Signed-off-by: Elshad Seyidmammadov <elshad@eclipsesource.com>
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.rap.rwt/js/rwt/widgets/base/Window.js29
1 files changed, 15 insertions, 14 deletions
diff --git a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/base/Window.js b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/base/Window.js
index b82e7adb28..05cfbfab86 100644
--- a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/base/Window.js
+++ b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/base/Window.js
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2014 1&1 Internet AG, Germany, http://www.1und1.de,
+ * Copyright (c) 2004, 2016 1&1 Internet AG, Germany, http://www.1und1.de,
* EclipseSource and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -1343,9 +1343,6 @@ rwt.qx.Class.define("rwt.widgets.base.Window",
e.stopPropagation();
},
-
-
-
/*
---------------------------------------------------------------------------
EVENTS: CAPTIONBAR
@@ -1379,17 +1376,18 @@ rwt.qx.Class.define("rwt.widgets.base.Window",
// compute locations
var paLoc = rwt.html.Location.get(pl, "scroll");
var elLoc = rwt.html.Location.get(el);
+ var scrollX = rwt.html.Viewport.getScrollLeft();
+ var scrollY = rwt.html.Viewport.getScrollTop();
this._dragSession =
{
- offsetX : e.getPageX() - elLoc.left + paLoc.left,
- offsetY : e.getPageY() - elLoc.top + paLoc.top,
- parentAvailableAreaLeft : paLoc.left + 5,
- parentAvailableAreaTop : paLoc.top + 5,
- parentAvailableAreaRight : paLoc.right - 5,
- parentAvailableAreaBottom : paLoc.bottom - 5
+ offsetX : e.getPageX() - elLoc.left + paLoc.left + scrollX,
+ offsetY : e.getPageY() - elLoc.top + paLoc.top + scrollY,
+ parentAvailableAreaLeft : paLoc.left + scrollX + 5,
+ parentAvailableAreaTop : paLoc.top + scrollY + 5,
+ parentAvailableAreaRight : paLoc.right + scrollX - 5,
+ parentAvailableAreaBottom : paLoc.bottom + scrollY - 5
};
-
// handle frame and translucently
switch(this.getMoveMethod())
{
@@ -1485,16 +1483,19 @@ rwt.qx.Class.define("rwt.widgets.base.Window",
return;
}
+ var x = this._appModal ? e.getClientX() : e.getPageX();
+ var y = this._appModal ? e.getClientY() : e.getPageY();
+
// pre check if we go out of the available area
- if (!rwt.util.Numbers.isBetween(e.getPageX(), s.parentAvailableAreaLeft, s.parentAvailableAreaRight) || !rwt.util.Numbers.isBetween(e.getPageY(), s.parentAvailableAreaTop, s.parentAvailableAreaBottom)) {
+ if (!rwt.util.Numbers.isBetween(x, s.parentAvailableAreaLeft, s.parentAvailableAreaRight) || !rwt.util.Numbers.isBetween(y, s.parentAvailableAreaTop, s.parentAvailableAreaBottom)) {
return;
}
// use the fast and direct dom methods
var o = this.getMoveMethod() == "frame" ? this._frame : this;
- o._renderRuntimeLeft(s.lastX = e.getPageX() - s.offsetX);
- o._renderRuntimeTop(s.lastY = e.getPageY() - s.offsetY);
+ o._renderRuntimeLeft(s.lastX = x - s.offsetX);
+ o._renderRuntimeTop(s.lastY = y - s.offsetY);
},

Back to the top