[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - 2 commits - loleaflet/dist

Jan Holesovsky kendy at collabora.com
Fri Jul 28 16:13:56 UTC 2017


 loleaflet/dist/loleaflet.css      |    2 +-
 loleaflet/dist/loleaflet.html     |    4 ++++
 loleaflet/dist/menubar.css        |    6 ------
 loleaflet/dist/toolbar.css        |   20 +++++++++++++++++---
 loleaflet/dist/toolbar/toolbar.js |   21 ++++++++++-----------
 5 files changed, 32 insertions(+), 21 deletions(-)

New commits:
commit b7764282646c3fbb270c8b2408b18fd06fe4d676
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Fri Jul 28 18:13:07 2017 +0200

    Align the close button with the 'more' toolbar button.
    
    Change-Id: Id7997da325adb6df89155605d6978b6da39890f4

diff --git a/loleaflet/dist/toolbar.css b/loleaflet/dist/toolbar.css
index f219ea7c..ab8894ca 100644
--- a/loleaflet/dist/toolbar.css
+++ b/loleaflet/dist/toolbar.css
@@ -65,14 +65,14 @@
 #closebuttonwrapper {
     position: fixed;
     z-index: 1050;
-    right: 0;
+    right: 4px;
     top: 0;
-    width: 26px;
-    height: 26px;
+    width: 31px;
+    height: 31px;
 }
 #closebutton {
-    width: 24px;
-    height: 24px;
+    width: 31px;
+    height: 31px;
     border: 1px solid;
     border-color: transparent;
     border-radius: 5px;
commit 60257055a55c4e0f4744ce1e22acec7282d2639c
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Thu Jun 22 19:47:26 2017 +0530

    loleaflet: Detach closebutton from toolbar
    
    This is so because we require this also when document is opened in
    readonly mode and we don't have any toolbar in the readonly mode.
    
    Change-Id: I085d1640f52843e01370d528d6eea656b743d908
    (cherry picked from commit 1e6c345715b406d4ab0f255b8cb5e815e795956f)

diff --git a/loleaflet/dist/loleaflet.css b/loleaflet/dist/loleaflet.css
index 010d8894..a0604c5f 100644
--- a/loleaflet/dist/loleaflet.css
+++ b/loleaflet/dist/loleaflet.css
@@ -101,7 +101,7 @@ body {
     #tb_toolbar-up_item_rightmenupadding {
 	padding-right: 40px;
     }
-    #tb_toolbar-up_item_close {
+    #closebutton {
 	display: none;
     }
 }
diff --git a/loleaflet/dist/loleaflet.html b/loleaflet/dist/loleaflet.html
index dfa03200..f4f5e541 100644
--- a/loleaflet/dist/loleaflet.html
+++ b/loleaflet/dist/loleaflet.html
@@ -53,6 +53,10 @@
       <input id="insertgraphic" type="file" style="position: fixed; top: -100em">
     </div>
 
+    <div id="closebuttonwrapper">
+      <div class="closebuttonimage" id="closebutton"></div>
+    </div>
+
     <div id="spreadsheet-row-column-frame">
     </div>
 
diff --git a/loleaflet/dist/menubar.css b/loleaflet/dist/menubar.css
index 9d57445b..d3a35fce 100644
--- a/loleaflet/dist/menubar.css
+++ b/loleaflet/dist/menubar.css
@@ -218,12 +218,6 @@
     #menu-closedocument {
 	display: none;
     }
-    /* In readonly mode, we have no toolbar => no close button,
-     * so only way to close the document is file menu option
-     */
-    #menu-closedocument.readonly {
-	display: block;
-    }
 
     .readonly {
 	top: 3px;
diff --git a/loleaflet/dist/toolbar.css b/loleaflet/dist/toolbar.css
index 656c9800..f219ea7c 100644
--- a/loleaflet/dist/toolbar.css
+++ b/loleaflet/dist/toolbar.css
@@ -62,12 +62,27 @@
     width: 700px;
 }
 
-#tb_toolbar-up_item_close {
+#closebuttonwrapper {
     position: fixed;
     z-index: 1050;
     right: 0;
     top: 0;
+    width: 26px;
+    height: 26px;
 }
+#closebutton {
+    width: 24px;
+    height: 24px;
+    border: 1px solid;
+    border-color: transparent;
+    border-radius: 5px;
+}
+#closebutton:hover {
+    border-color: #ccc;
+    background-color: #eee;
+}
+.closebuttonimage{ background: url('../images/lc_closedoc.svg') no-repeat center !important; }
+
 #tb_toolbar-up_item_right {
     width: 100%;
 }
@@ -215,7 +230,6 @@ button.leaflet-control-search-next
 .w2ui-icon.bullet{ background: url('../images/lc_defaultbullet.svg') no-repeat center !important; }
 .w2ui-icon.cancel{ background: url('../images/lc_cancel.svg') no-repeat center !important; }
 .w2ui-icon.color{ background: url('../images/lc_color.svg') no-repeat center !important; }
-.w2ui-icon.closedoc{ background: url('../images/lc_closedoc.svg') no-repeat center !important; }
 .w2ui-icon.decrementindent{ background: url('../images/lc_decrementindent.svg') no-repeat center !important; }
 .w2ui-icon.deletepage{ background: url('../images/lc_deletepage.svg') no-repeat center !important; }
 .w2ui-icon.duplicatepage{ background: url('../images/lc_duplicatepage.svg') no-repeat center !important; }
diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index c0ea64e9..fbb9322a 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -27,8 +27,7 @@ var toolbarUpMobileItems = [
 	'rightpara',
 	'justifypara',
 	'right',
-	'rightmenupadding',
-	'close'
+	'rightmenupadding'
 ];
 
 var statusbarMobileItems = [
@@ -131,7 +130,7 @@ function resizeToolbar() {
 
 	// move items from toolbar-up -> toolbar-up-more
 	while ($('#toolbar-up')[0].scrollWidth > Math.max($(window).width(), parseInt($('body').css('min-width')))) {
-		var itemId = toolbarUp.items[toolbarUp.items.length - 5].id;
+		var itemId = toolbarUp.items[toolbarUp.items.length - 4].id;
 		item = toolbarUp.get(itemId);
 		toolbarUp.remove(itemId);
 		toolbarUpMore.insert(toolbarUpMore.items[0], item);
@@ -341,10 +340,6 @@ function onClick(id, item, subItem) {
 		w2ui['toolbar-up-more'].render();
 		resizeToolbar();
 	}
-	else if (id === 'close') {
-		map.fire('postMessage', {msgId: 'UI_Close', args: {EverModified: map._everModified}});
-		map.remove();
-	}
 	else if (id === 'specialcharacter') {
 		var fontList = $('.fonts-select option');
 		var selectedIndex = $('.fonts-select').prop('selectedIndex');
@@ -509,8 +504,7 @@ $(function () {
 			{type: 'button',  id: 'specialcharacter', img: 'specialcharacter', hint: _('Special Character')},
 			{type: 'html', id: 'right'},
 			{type: 'button',  id: 'more', img: 'more', hint: _('More')},
-			{type: 'html', id: 'rightmenupadding'},
-			{type: 'button',  id: 'close',  img: 'closedoc', hint: _('Close document'), hidden: true}
+			{type: 'html', id: 'rightmenupadding'}
 		],
 		onClick: function (e) {
 			onClick(e.target);
@@ -1672,8 +1666,13 @@ $(window).resize(function() {
 
 $(document).ready(function() {
 	var toolbar = w2ui['toolbar-up'];
-	if (closebutton) {
-		toolbar.show('close');
+	if (!closebutton) {
+		$('#closebuttonwrapper').hide();
+	} else {
+		$('#closebutton').click(function(e) {
+			map.fire('postMessage', {msgId: 'UI_Close', args: {EverModified: map._everModified}});
+			map.remove();
+		});
 	}
 
 	// Attach insert file action


More information about the Libreoffice-commits mailing list