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

Szymon Kłos (via logerrit) logerrit at kemper.freedesktop.org
Mon Sep 30 14:07:53 UTC 2019


 loleaflet/src/control/Control.Toolbar.js |   43 ++++++++++++++++++-------------
 1 file changed, 26 insertions(+), 17 deletions(-)

New commits:
commit e498d0285f9597223533f612909fd4e9a17449e0
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Mon Sep 30 16:05:53 2019 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Mon Sep 30 16:07:41 2019 +0200

    Don't show white space under rows on mobile in readonly mode
    
    Change-Id: Ie443781210c7b44463c26fdf2017c50a57449d29
    Reviewed-on: https://gerrit.libreoffice.org/79867
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js
index a8d470481..ec76950bc 100644
--- a/loleaflet/src/control/Control.Toolbar.js
+++ b/loleaflet/src/control/Control.Toolbar.js
@@ -2113,7 +2113,7 @@ function onUpdatePermission(e) {
 				break;
 			case 'spreadsheet':
 				$('#document-container').css('bottom', '35px');
-				$('#spreadsheet-row-column-frame').css('bottom', '68px');
+				$('#spreadsheet-row-column-frame').css('bottom', '35px');
 				$('#spreadsheet-toolbar').show();
 				break;
 			case 'presentation':
commit d5e9a882846f78a6aaa4377571e344aec338f4f7
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Mon Sep 30 16:03:40 2019 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Mon Sep 30 16:07:35 2019 +0200

    Avoid using uninitialized toolbars on mobile
    
    Change-Id: I5579c8efcaadfce86275f0c08c1b4f7dcb803dc4
    Reviewed-on: https://gerrit.libreoffice.org/79866
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js
index 5f98160d0..a8d470481 100644
--- a/loleaflet/src/control/Control.Toolbar.js
+++ b/loleaflet/src/control/Control.Toolbar.js
@@ -39,6 +39,9 @@ global.mode = {
 var nUsers, oneUser, noUser;
 
 function _updateVisibilityForToolbar(toolbar) {
+	if (!toolbar)
+		return;
+
 	var isDesktop = _inDesktopMode();
 	var isMobile = _inMobileMode();
 	var isTablet = _inTabletMode();
@@ -1358,20 +1361,24 @@ function onDocLayerInit() {
 
 	switch (docType) {
 	case 'spreadsheet':
-		toolbarUp.show('textalign', 'wraptext', 'breakspacing', 'insertannotation', 'conditionalformaticonset',
+		if (toolbarUp) {
+			toolbarUp.show('textalign', 'wraptext', 'breakspacing', 'insertannotation', 'conditionalformaticonset',
 			'numberformatcurrency', 'numberformatpercent',
 			'numberformatincdecimals', 'numberformatdecdecimals', 'break-number', 'togglemergecells', 'breakmergecells',
 			'setborderstyle', 'sortascending', 'sortdescending', 'breaksorting', 'backgroundcolor', 'breaksidebar', 'sidebar');
-		toolbarUp.remove('styles');
+			toolbarUp.remove('styles');
+		}
 
-		statusbar.remove('prev', 'next', 'prevnextbreak');
+		if (statusbar) {
+			statusbar.remove('prev', 'next', 'prevnextbreak');
 
-		statusbar.set('zoom', {
-			items: [
-				{ id: 'zoom100', text: '100%', scale: 10},
-				{ id: 'zoom200', text: '200%', scale: 14}
-			]
-		});
+			statusbar.set('zoom', {
+				items: [
+					{ id: 'zoom100', text: '100%', scale: 10},
+					{ id: 'zoom200', text: '200%', scale: 14}
+				]
+			});
+		}
 
 		if (!_inMobileMode()) {
 			statusbar.insert('left', [
@@ -1509,8 +1516,10 @@ function onDocLayerInit() {
 	}
 
 	updateUserListCount();
-	toolbarUp.refresh();
-	statusbar.refresh();
+	if (toolbarUp)
+		toolbarUp.refresh();
+	if (statusbar)
+		statusbar.refresh();
 
 	if (!window.ThisIsTheiOSApp && window.mode.isTablet()) {
 		map.hideMenubar();
@@ -2203,8 +2212,8 @@ function getUserItem(viewId, userName, extraInfo, color) {
 }
 
 function updateUserListCount() {
-	var userlistItem = w2ui['actionbar'].get('userlist');
-	if (userlistItem === null) {
+	var userlistItem = w2ui.actionbar && w2ui['actionbar'].get('userlist');
+	if (userlistItem == null) {
 		return;
 	}
 
@@ -2407,10 +2416,10 @@ function setupToolbar(e) {
 				w2utils.unlock(w2ui['actionbar'].box);
 			}
 		});
-
-		map.on('doclayerinit', onDocLayerInit);
-		map.on('updatepermission', onUpdatePermission);
 	}
+
+	map.on('doclayerinit', onDocLayerInit);
+	map.on('updatepermission', onUpdatePermission);
 	map.on('wopiprops', onWopiProps);
 	map.on('commandresult', onCommandResult);
 	map.on('updateparts pagenumberchanged', onUpdateParts);


More information about the Libreoffice-commits mailing list