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

Jan Holesovsky kendy at collabora.com
Wed Apr 6 07:01:09 UTC 2016


 loleaflet/dist/toolbar/toolbar.js |   11 +++++++++++
 1 file changed, 11 insertions(+)

New commits:
commit fa4ea0200b0b24daad03416dfcec511e66a66b73
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Apr 6 08:59:44 2016 +0200

    loleaflet: Show the 'More' button only when there are more items.

diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index ce4a000..906eb76 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -923,6 +923,8 @@ $(document).ready(function() {
 });
 
 function resizeToolbar() {
+	var has_more_items = false;
+
 	// move items from toolbar-up-more -> toolbar-up
 	while ($('#toolbar-up')[0].scrollWidth <= $(window).width()) {
 		var firstItem = $('#toolbar-up-more>table>tbody>tr>td:first');
@@ -937,6 +939,15 @@ function resizeToolbar() {
 	while ($('#toolbar-up')[0].scrollWidth > $(window).width()) {
 		var detached = $('#toolbar-up>table>tbody>tr>td:nth-last-child(5)').detach();
 		$('#toolbar-up-more>table>tbody>tr').prepend(detached);
+
+		has_more_items = true;
+	}
+
+	if (has_more_items) {
+		w2ui['toolbar-up'].show('more');
+	}
+	else {
+		w2ui['toolbar-up'].hide('more');
 	}
 
 	// resize toolbar-up-more


More information about the Libreoffice-commits mailing list