loleaflet/src/control/Control.LokDialog.js |   19 ++++++++++++-------
 loleaflet/src/dom/DomUtil.js               |    2 ++
 2 files changed, 14 insertions(+), 7 deletions(-)

New commits:
commit 040fa3c77c8fbf4474b715f9d3a815cf98295686
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Thu Jul 4 00:03:19 2019 -0400
Commit:     Henry Castro <hcas...@collabora.com>
CommitDate: Tue Aug 20 17:12:06 2019 +0200

    loeaflet: mobile: adjust the dialog position to top center, part2
    
    Change-Id: Ie53ff4702a1559e4e3387adb8f12a70907b43118
    Reviewed-on: https://gerrit.libreoffice.org/77840
    Reviewed-by: Henry Castro <hcas...@collabora.com>
    Tested-by: Henry Castro <hcas...@collabora.com>

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index cb4a68e5b..98aa1a5c7 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -23,6 +23,10 @@ function updateTransformation(target) {
                target.value.style.webkitTransform = value;
                target.value.style.mozTransform = value;
                target.value.style.transform = value;
+
+               if (target.transformation.origin) {
+                       target.value.style[L.DomUtil.TRANSFORM_ORIGIN] = 
target.transformation.origin;
+               }
        }
 }
 
@@ -543,13 +547,6 @@ L.Control.LokDialog = L.Control.extend({
                        offsetY = -(height - window.screen.height) / 2;
                }
 
-               // on mobile, force the positioning to the top, so that it is 
not
-               // covered by the virtual keyboard
-               if (window.mode.isMobile()) {
-                       $(dialogContainer).dialog('option', 'position', { my: 
'left top', at: 'let top', of: window });
-                       offsetY = 0;
-               }
-
                var state = {
                        startX: offsetX,
                        startY: offsetY,
@@ -564,6 +561,14 @@ L.Control.LokDialog = L.Control.extend({
                        rz: 0
                };
 
+               // on mobile, force the positioning to the top, so that it is 
not
+               // covered by the virtual keyboard
+               if (window.mode.isMobile()) {
+                       $(dialogContainer).dialog('option', 'position', { my: 
'left top', at: 'let top', of: '#document-container' });
+                       transformation.origin = 'center top';
+                       transformation.translate.y = 0;
+               }
+
                if (findZoomTarget(targetId) != null) {
                        removeZoomTarget(targetId);
                }
diff --git a/loleaflet/src/dom/DomUtil.js b/loleaflet/src/dom/DomUtil.js
index 4e53f2394..26a05a89e 100644
--- a/loleaflet/src/dom/DomUtil.js
+++ b/loleaflet/src/dom/DomUtil.js
@@ -192,6 +192,8 @@ L.DomUtil = {
        L.DomUtil.TRANSFORM = L.DomUtil.testProp(
                        ['transform', 'WebkitTransform', 'OTransform', 
'MozTransform', 'msTransform']);
 
+       L.DomUtil.TRANSFORM_ORIGIN = L.DomUtil.testProp(
+                       ['transformOrigin', 'msTransformOrigin', 
'WebkitTransformOrigin']);
 
        // webkitTransition comes first because some browser versions that drop 
vendor prefix don't do
        // the same for the transitionend event, in particular the Android 4.1 
stock browser
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to