[Libreoffice-commits] online.git: loleaflet/css loleaflet/js

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Nov 19 10:16:35 UTC 2018


 loleaflet/css/loleaflet.css |    1 
 loleaflet/js/toolbar.js     |  135 ++++++++++++++++++++++++--------------------
 2 files changed, 75 insertions(+), 61 deletions(-)

New commits:
commit e044375ff53ec231426c9b4186c8ac178c5368d4
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Tue Sep 11 20:59:08 2018 -0400
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Mon Nov 19 12:02:53 2018 +0200

    loleaflet: mobile: hide statusbar
    
    Change-Id: I48370e0e5d2b28436d5cc7c2c12c42bc37f07714

diff --git a/loleaflet/css/loleaflet.css b/loleaflet/css/loleaflet.css
index 43c58e0fc..01a3830c6 100644
--- a/loleaflet/css/loleaflet.css
+++ b/loleaflet/css/loleaflet.css
@@ -98,6 +98,7 @@ body {
     }
     #document-container {
 	top: 40px;
+	bottom: 0;
     }
     #spreadsheet-row-column-frame {
 	top: 73px !important;
diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index a10e8b665..e5439c7e9 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -856,69 +856,78 @@ function createToolbar() {
 	});
 
 	toolbar = $('#toolbar-down');
-	toolbar.w2toolbar({
-		name: 'toolbar-down',
-		tooltip: 'top',
-		items: [
-			{type: 'html',  id: 'search',
-			 html: '<div style="padding: 3px 10px;" class="loleaflet-font">' +
-			 ' ' + _('Search:') +
-			 '    <input size="10" id="search-input"' +
-			 'style="padding: 3px; border-radius: 2px; border: 1px solid silver"/>' +
-			 '</div>'
-			},
-			{type: 'button',  id: 'searchprev', img: 'prev', hint: _UNO('.uno:UpSearch'), disabled: true},
-			{type: 'button',  id: 'searchnext', img: 'next', hint: _UNO('.uno:DownSearch'), disabled: true},
-			{type: 'button',  id: 'cancelsearch', img: 'cancel', hint: _('Cancel the search'), hidden: true},
-			{type: 'html',  id: 'left'},
-			{type: 'html',  id: 'right'},
-			{type: 'html',    id: 'modifiedstatuslabel', html: '<div id="modifiedstatuslabel" class="loleaflet-font"></div>', mobile:false},
-			{type: 'break', id: 'modifiedstatuslabelbreak', mobile:false},
-			{type: 'drop', id: 'userlist', text: _('No users'), html: '<div id="userlist_container"><table id="userlist_table"><tbody></tbody></table>' +
-				'<hr><table class="loleaflet-font" id="editor-btn">' +
-				'<tr>' +
-				'<td><input type="checkbox" name="alwaysFollow" id="follow-checkbox" onclick="editorUpdate(event)"></td>' +
-				'<td>' + _('Always follow the editor') + '</td>' +
-				'</tr>' +
-				'</table>' +
-				'<p id="currently-msg">' + _('Current') + ' - <b><span id="current-editor"></span></b></p>' +
-				'</div>'
+	if ($('#main-menu').css('display') !== 'none') {
+		toolbar.w2toolbar({
+			name: 'toolbar-down',
+			tooltip: 'top',
+			items: [
+				{type: 'html',  id: 'search',
+				 html: '<div style="padding: 3px 10px;" class="loleaflet-font">' +
+				 ' ' + _('Search:') +
+				 '    <input size="10" id="search-input"' +
+				 'style="padding: 3px; border-radius: 2px; border: 1px solid silver"/>' +
+				 '</div>'
+				},
+				{type: 'button',  id: 'searchprev', img: 'prev', hint: _UNO('.uno:UpSearch'), disabled: true},
+				{type: 'button',  id: 'searchnext', img: 'next', hint: _UNO('.uno:DownSearch'), disabled: true},
+				{type: 'button',  id: 'cancelsearch', img: 'cancel', hint: _('Cancel the search'), hidden: true},
+				{type: 'html',  id: 'left'},
+				{type: 'html',  id: 'right'},
+				{type: 'html',    id: 'modifiedstatuslabel', html: '<div id="modifiedstatuslabel" class="loleaflet-font"></div>', mobile:false},
+				{type: 'break', id: 'modifiedstatuslabelbreak', mobile:false},
+				{type: 'drop', id: 'userlist', text: _('No users'), html: '<div id="userlist_container"><table id="userlist_table"><tbody></tbody></table>' +
+					'<hr><table class="loleaflet-font" id="editor-btn">' +
+					'<tr>' +
+					'<td><input type="checkbox" name="alwaysFollow" id="follow-checkbox" onclick="editorUpdate(event)"></td>' +
+					'<td>' + _('Always follow the editor') + '</td>' +
+					'</tr>' +
+					'</table>' +
+					'<p id="currently-msg">' + _('Current') + ' - <b><span id="current-editor"></span></b></p>' +
+					'</div>'
+				},
+				{type: 'break', id: 'userlistbreak'},
+				{type: 'button',  id: 'prev', img: 'prev', hint: _UNO('.uno:PageUp', 'text')},
+				{type: 'button',  id: 'next', img: 'next', hint: _UNO('.uno:PageDown', 'text')},
+				{type: 'break', id: 'prevnextbreak'},
+				{type: 'button',  id: 'zoomreset', img: 'zoomreset', hint: _('Reset zoom')},
+				{type: 'button',  id: 'zoomout', img: 'zoomout', hint: _UNO('.uno:ZoomMinus')},
+				{type: 'html',    id: 'zoomlevel', html: '<div id="zoomlevel" class="loleaflet-font">100%</div>', mobile: false},
+				{type: 'button',  id: 'zoomin', img: 'zoomin', hint: _UNO('.uno:ZoomPlus')}
+			],
+			onClick: function (e) {
+				hideTooltip(this, e.target);
+				if (e.item.id === 'userlist') {
+					setTimeout(function() {
+						var cBox = $('#follow-checkbox')[0];
+						var docLayer = map._docLayer;
+						var editorId = docLayer._editorId;
+
+						if (cBox)
+							cBox.checked = docLayer._followEditor;
+
+						if (docLayer.editorId !== -1 && map._viewInfo[editorId])
+							$('#current-editor').text(map._viewInfo[editorId].username);
+						else
+							$('#currently-msg').hide();
+					}, 100);
+					return;
+				}
+				onClick(e, e.target, e.item, e.subItem);
 			},
-			{type: 'break', id: 'userlistbreak'},
-			{type: 'button',  id: 'prev', img: 'prev', hint: _UNO('.uno:PageUp', 'text')},
-			{type: 'button',  id: 'next', img: 'next', hint: _UNO('.uno:PageDown', 'text')},
-			{type: 'break', id: 'prevnextbreak'},
-			{type: 'button',  id: 'zoomreset', img: 'zoomreset', hint: _('Reset zoom')},
-			{type: 'button',  id: 'zoomout', img: 'zoomout', hint: _UNO('.uno:ZoomMinus')},
-			{type: 'html',    id: 'zoomlevel', html: '<div id="zoomlevel" class="loleaflet-font">100%</div>', mobile: false},
-			{type: 'button',  id: 'zoomin', img: 'zoomin', hint: _UNO('.uno:ZoomPlus')}
-		],
-		onClick: function (e) {
-			hideTooltip(this, e.target);
-			if (e.item.id === 'userlist') {
-				setTimeout(function() {
-					var cBox = $('#follow-checkbox')[0];
-					var docLayer = map._docLayer;
-					var editorId = docLayer._editorId;
-
-					if (cBox)
-						cBox.checked = docLayer._followEditor;
-
-					if (docLayer.editorId !== -1 && map._viewInfo[editorId])
-						$('#current-editor').text(map._viewInfo[editorId].username);
-					else
-						$('#currently-msg').hide();
-				}, 100);
-				return;
+			onRefresh: function() {
+				$('#tb_toolbar-down_item_userlist .w2ui-tb-caption').addClass('loleaflet-font');
+				$('#search-input').off('input', onSearch).on('input', onSearch);
+				$('#search-input').off('keydown', onSearchKeyDown).on('keydown', onSearchKeyDown);
 			}
-			onClick(e, e.target, e.item, e.subItem);
-		},
-		onRefresh: function() {
-			$('#tb_toolbar-down_item_userlist .w2ui-tb-caption').addClass('loleaflet-font');
-			$('#search-input').off('input', onSearch).on('input', onSearch);
-			$('#search-input').off('keydown', onSearchKeyDown).on('keydown', onSearchKeyDown);
-		}
-	});
+		});
+	}
+	else {
+		toolbar.w2toolbar({
+			name: 'toolbar-down',
+			tooltip: 'top',
+			items: []
+		});
+	}
 	toolbar.bind('touchstart', function() {
 		w2ui['toolbar-down'].touchStarted = true;
 	});
@@ -1233,6 +1242,10 @@ function onWopiProps(e) {
 }
 
 function onDocLayerInit() {
+	if ($('#main-menu').css('display') === 'none') {
+		return;
+	}
+
 	var toolbarUp = w2ui['toolbar-up'];
 	var statusbar = w2ui['toolbar-down'];
 	var docType = map.getDocType();


More information about the Libreoffice-commits mailing list