[Libreoffice-commits] online.git: loleaflet/js
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Aug 8 20:18:08 UTC 2018
loleaflet/js/toolbar.js | 44 ++++++++------------------------------------
1 file changed, 8 insertions(+), 36 deletions(-)
New commits:
commit c738beea870c3b697db7715d10b5e77562b85f55
Author: Henry Castro <hcastro at collabora.com>
AuthorDate: Wed Aug 8 09:05:50 2018 -0400
Commit: Henry Castro <hcastro at 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) {
More information about the Libreoffice-commits
mailing list