loleaflet/js/toolbar.js |   44 ++++++++------------------------------------
 1 file changed, 8 insertions(+), 36 deletions(-)

New commits:
commit c738beea870c3b697db7715d10b5e77562b85f55
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Wed Aug 8 09:05:50 2018 -0400
Commit:     Henry Castro <hcas...@collabora.com>
CommitDate: Wed Aug 8 16:17:31 2018 -0400

    loleaflet: mobile: fix the status bar that loses the input focus
    
    Change-Id: Ia39a33295e3a1c153636e2dd33a232cbe2b399b7

diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index 5f3279c97..b2c4bd234 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -8,7 +8,6 @@
 (function(global) {
 
 var map;
-var mobileWidth = 768;
 
 function onDelete(e) {
        if (e !== false) {
@@ -42,42 +41,13 @@ function _mobilify() {
        $('#document-name-input').hide();
 }
 
-function _unmobilify() {
-       var toolbarUp = w2ui['toolbar-up'];
-       var statusbar = w2ui['toolbar-down'];
-
-       toolbarUp.items.forEach(function(item) {
-               if (item.mobile === false && item.hidden) {
-                       toolbarUp.show(item.id);
-               }
-       });
-
-       statusbar.items.forEach(function(item) {
-               if (item.mobile === false && item.hidden) {
-                       statusbar.show(item.id);
-               }
-       });
-
-       nUsers = _('%n users');
-       oneUser = _('1 user');
-       noUser = _('0 users');
-       updateUserListCount();
-
-       $('#document-name-input').show();
-}
-
 function resizeToolbar() {
-       var toolbarUp = w2ui['toolbar-up'];
-       var statusbar = w2ui['toolbar-down'];
-
-       if ($(window).width() < mobileWidth) {
-               _mobilify();
-       } else {
-               _unmobilify();
+       if ($(window).width() !== map.getSize().x) {
+               var toolbarUp = w2ui['toolbar-up'];
+               var statusbar = w2ui['toolbar-down'];
+               toolbarUp.resize();
+               statusbar.resize();
        }
-
-       toolbarUp.resize();
-       statusbar.resize();
 }
 
 function _cancelSearch() {
@@ -1272,7 +1242,9 @@ function onDocLayerInit() {
        }
        toolbarUp.refresh();
        statusbar.refresh();
-       resizeToolbar();
+       if (L.Browser.mobile) {
+               _mobilify();
+       }
 }
 
 function onCommandStateChanged(e) {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to