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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Mar 13 15:41:47 UTC 2019


 loleaflet/css/loleaflet.css              |    6 ++++
 loleaflet/css/menubar.css                |    9 +++----
 loleaflet/html/loleaflet.html.m4         |    3 --
 loleaflet/src/control/Control.Menubar.js |   39 ++++++++++++++++++++++---------
 4 files changed, 39 insertions(+), 18 deletions(-)

New commits:
commit a533fad1f29b24983b850477291789a2623fb0b9
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Mar 12 16:40:55 2019 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Mar 13 16:41:30 2019 +0100

    Don't wrap menubar
    
    Change-Id: I5283a20d50dceb945378b47fc5678798dfa52608
    Reviewed-on: https://gerrit.libreoffice.org/69159
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/loleaflet/css/loleaflet.css b/loleaflet/css/loleaflet.css
index b79b56a53..c9a590215 100644
--- a/loleaflet/css/loleaflet.css
+++ b/loleaflet/css/loleaflet.css
@@ -105,6 +105,12 @@ body {
 	background: url('images/baseline-edit-24px.svg') no-repeat center !important;
 }
 
+ at media (max-width: 900px),(max-device-height: 900px) {
+	#menu-last-mod {
+		display: none;
+	}
+}
+
 @media (max-width: 767px),(max-device-height: 767px) {
 	/* Show slidesorter beyond 768px only */
 	#presentation-controls-wrapper {
diff --git a/loleaflet/css/menubar.css b/loleaflet/css/menubar.css
index f8ec2e3ba..099210f9c 100644
--- a/loleaflet/css/menubar.css
+++ b/loleaflet/css/menubar.css
@@ -6,6 +6,8 @@
     float: left;
     background-color: transparent;
     margin-left: 5px;
+    white-space: nowrap;
+    display: inline;
 }
 
 #main-menu.readonly {
@@ -15,11 +17,10 @@
 #document-header {
     position: relative;
     background: #ffffff;
-    margin-left: 5px;
-    float: left;
+    margin-right: 5px;
 }
 
-#document-logo {
+.document-logo {
 	position: relative;
 	width: 22px;
 	height: 30px;
@@ -256,7 +257,7 @@
 }
 
 @media (max-width: 767px),(max-device-height: 767px) {
-    #document-logo {
+    .document-logo {
         width: 35px;
         height: 38px;
     }
diff --git a/loleaflet/html/loleaflet.html.m4 b/loleaflet/html/loleaflet.html.m4
index 5c4a03dc4..28f2ea4b4 100644
--- a/loleaflet/html/loleaflet.html.m4
+++ b/loleaflet/html/loleaflet.html.m4
@@ -73,9 +73,6 @@ ifelse(MOBILEAPP,[true],
         cause the content to overflow, creating scrollbars -->
 
      <nav class="main-nav" role="navigation">
-       <div id="document-header">
-        <div id="document-logo" class="document-logo"></div>
-       </div>
        <!-- Mobile menu toggle button (hamburger/x icon) -->
        <input id="main-menu-state" type="checkbox" style="display: none"/>
        <ul id="main-menu" class="sm sm-simple lo-menu readonly"></ul>
diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index 872f1d340..fb44a280b 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -539,6 +539,10 @@ L.Control.Menubar = L.Control.extend({
 			subIndicatorsText: '›'
 		});
 		$('#main-menu').attr('tabindex', 0);
+
+		if (this._map._permission !== 'readonly') {
+			this._createFileIcon();
+		}
 	},
 
 	_onStyleMenu: function (e) {
@@ -567,17 +571,6 @@ L.Control.Menubar = L.Control.extend({
 	_onDocLayerInit: function() {
 		this._onRefresh();
 
-		var docType = this._map.getDocType();
-		var $docLogo = $('#document-logo');
-		$docLogo.bind('click', {self: this}, this._createDocument);
-		if (docType === 'text') {
-			$docLogo.addClass('writer-icon-img');
-		} else if (docType === 'spreadsheet') {
-			$docLogo.addClass('calc-icon-img');
-		} else if (docType === 'presentation' || docType === 'drawing') {
-			$docLogo.addClass('impress-icon-img');
-		}
-
 		$('#main-menu').bind('select.smapi', {self: this}, this._onItemSelected);
 		$('#main-menu').bind('mouseenter.smapi', {self: this}, this._onMouseEnter);
 		$('#main-menu').bind('mouseleave.smapi', {self: this}, this._onMouseLeave);
@@ -839,6 +832,30 @@ L.Control.Menubar = L.Control.extend({
 		}
 	},
 
+	_createFileIcon: function() {
+		var iconClass = 'document-logo';
+		var docType = this._map.getDocType();
+		if (docType === 'text') {
+			iconClass += ' writer-icon-img';
+		} else if (docType === 'spreadsheet') {
+			iconClass += ' calc-icon-img';
+		} else if (docType === 'presentation' || docType === 'drawing') {
+			iconClass += ' impress-icon-img';
+		}
+
+		var liItem = L.DomUtil.create('li', '');
+		liItem.id = 'document-header';
+		var aItem = L.DomUtil.create('div', iconClass, liItem);
+		$(aItem).data('id', 'document-logo');
+		$(aItem).data('type', 'action');
+
+		this._menubarCont.insertBefore(liItem, this._menubarCont.firstChild);
+
+		var $docLogo = $(aItem);
+		$docLogo.bind('click', {self: this}, this._createDocument);
+
+	},
+
 	_createMenu: function(menu) {
 		var itemList = [];
 		var docType = this._map.getDocType();


More information about the Libreoffice-commits mailing list