[Libreoffice-commits] online.git: loleaflet/src

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Fri Nov 15 14:49:53 UTC 2019


 loleaflet/src/control/Control.LokDialog.js |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit d93d9dc59b2ef4e48b7d768a3df8ef153d4e51e2
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Wed Jul 24 17:57:29 2019 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Fri Nov 15 15:49:32 2019 +0100

    loleaflet: fix the dragging limits of the dialog box
    
    Change-Id: Id6336ce5bde9567c3a99c4660e8445f65f7545a2
    Reviewed-on: https://gerrit.libreoffice.org/82535
    Reviewed-by: Henry Castro <hcastro at collabora.com>
    Tested-by: Henry Castro <hcastro at collabora.com>

diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js
index 24646d46f..29c5cfef5 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -75,7 +75,11 @@ L.Control.LokDialog = L.Control.extend({
 				(newX < -target.width/2 || newY < -target.height/2
 				|| newX > window.innerWidth - target.width/2
 				|| newY > window.innerHeight - target.height/2)) {
-				return;
+				var dialog = $('.lokdialog_container');
+				var left = parseFloat(dialog.css('left'));
+				var top = parseFloat(dialog.css('top'));
+				newX = Math.max(newX, -left);
+				newY = Math.max(newY, -top);
 			}
 
 			target.transformation.translate = {


More information about the Libreoffice-commits mailing list