loleaflet/src/control/Toolbar.js |   24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

New commits:
commit 813746c7c2bdbac6af020132d4756b4a732193d5
Author:     Andras Timar <[email protected]>
AuthorDate: Fri Dec 28 16:15:15 2018 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Fri Dec 28 16:20:30 2018 +0100

    Better width of About and Help popup windows on narrow and wide screens
    
    Change-Id: I61e639a8a70282dc9e18fa1a4107f0572370947f
    Reviewed-on: https://gerrit.libreoffice.org/65686
    Reviewed-by: Andras Timar <[email protected]>
    Tested-by: Andras Timar <[email protected]>

diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index bdbf2a0d5..7e871a0db 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -180,7 +180,17 @@ L.Map.include({
        },
 
        showLOKeyboardHelp: function() {
-               var w = window.innerWidth / 2;
+               var w;
+               var iw = window.innerWidth;
+               if (iw < 768) {
+                       w = iw - 30;
+               }
+               else if (iw > 1920) {
+                       w = 960;
+               }
+               else {
+                       w = iw / 5 + 590;
+               }
                var map = this;
                $.get('loleaflet-help.html', function(data) {
                        vex.open({
@@ -254,7 +264,17 @@ L.Map.include({
                content.find('#product-name').text(productName);
                var productString = _('This version of %productName is powered 
by');
                
content.find('#product-string').text(productString.replace('%productName', 
productName));
-               var w = window.innerWidth / 2;
+               var w;
+               var iw = window.innerWidth;
+               if (iw < 768) {
+                       w = iw - 30;
+               }
+               else if (iw > 1920) {
+                       w = 960;
+               }
+               else {
+                       w = iw / 5 + 590;
+               }
                var map = this;
                var handler = function(event) {
                        if (event.keyCode === 68) {
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to