[Libreoffice-commits] online.git: loleaflet/dist

Pranav Kant pranavk at collabora.co.uk
Thu Jun 22 14:18:50 UTC 2017


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

New commits:
commit 1e6c345715b406d4ab0f255b8cb5e815e795956f
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

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 fed56051..b7d02f5c 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 448ec190..50392499 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);
@@ -346,10 +345,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');
@@ -525,8 +520,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);
@@ -1687,8 +1681,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