loleaflet/dist/toolbar/toolbar.js |   63 ++++++++++++++++++++++++--------------
 1 file changed, 40 insertions(+), 23 deletions(-)

New commits:
commit 90fae7f6d33b7542a6ee764041f73b763c6f35d1
Author: Jan Holesovsky <ke...@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
commit c6c3aa03f238c77b4a79107a5345c2838d781348
Author: Jan Holesovsky <ke...@collabora.com>
Date:   Tue Apr 5 17:55:05 2016 +0200

    loleaflet: It is not necessary to inform about EDITING, that's the default.

diff --git a/loleaflet/dist/toolbar/toolbar.js 
b/loleaflet/dist/toolbar/toolbar.js
index b797be2..ce4a000 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -895,12 +895,7 @@ map.on('editlock', function (e) {
                toolbar.disable('takeedit');
                toolbar.set('takeedit', {hint: _('You are editing (others can 
only view)')});
 
-               $('#takeedit_text')
-                       .w2tag('You are editing now')
-                       .html('EDITING');
-               setTimeout(function() {
-                       $('#takeedit_text').w2tag('');
-               }, 5000);
+               $('#takeedit_text').html('EDITING');
        }
        else {
                toolbar.uncheck('takeedit');
@@ -911,7 +906,7 @@ map.on('editlock', function (e) {
                        .html('VIEWING');
                setTimeout(function() {
                        $('#takeedit_text').w2tag('');
-               }, 5000);
+               }, 3000);
        }
 });
 
commit 28fbb8306068790b5ceb3a931bad4e1984e56e91
Author: Jan Holesovsky <ke...@collabora.com>
Date:   Tue Apr 5 17:22:44 2016 +0200

    bccu#1658: 'Enable editing' and 'Enable selection' buttons are not 
necessary.
    
    Also some other small tweaks, like disable the Previous / Next part buttons 
in
    spreadsheet, and better naming of them.

diff --git a/loleaflet/dist/toolbar/toolbar.js 
b/loleaflet/dist/toolbar/toolbar.js
index 911c5ff..b797be2 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -130,8 +130,6 @@ $(function () {
                        { type: 'button',  id: 'searchnext', img: 'next', hint: 
_("Search forward"), disabled: true },
                        { type: 'button',  id: 'cancelsearch', img: 'cancel', 
hint: _("Cancel the search"), hidden: true },
                        { type: 'html', id: 'left' },
-                       { type: 'button',  id: 'edit', img: 'edit', hint: 
_("Enable editing") },
-                       { type: 'button',  id: 'select', img: 'select', hint: 
_("Enable selection") },
                        { type: 'button',  id: 'presentation', img: 
'presentation', hint: _("Fullscreen presentation") },
                        { type: 'button',  id: 'insertpage', img: 'insertpage', 
hint: _("Insert Page") },
                        { type: 'button',  id: 'duplicatepage', img: 
'duplicatepage', hint: _("Duplicate Page") },
@@ -141,10 +139,10 @@ $(function () {
                        { type: 'button',  id: 'takeedit', img: 'edit', hint: 
_("Take edit lock (others can only view)")},
                        { type: 'html',    id: 'takeedit_text', html: '<div 
id="takeedit_text">VIEWING</div>' },
                        { type: 'break' },
-                       { type: 'button',  id: 'prev', img: 'prev', hint: 
_("Previous page/part") },
-                       { type: 'button',  id: 'next', img: 'next', hint: 
_("Next page/part") },
-                       { type: 'break' },
-                       { type: 'button',  id: 'zoomreset', img: 'zoomreset', 
hint: _("Reset") },
+                       { type: 'button',  id: 'prev', img: 'prev', hint: 
_("Previous page") },
+                       { type: 'button',  id: 'next', img: 'next', hint: 
_("Next page") },
+                       { type: 'break', id: 'prevnextbreak' },
+                       { type: 'button',  id: 'zoomreset', img: 'zoomreset', 
hint: _("Reset zoom") },
                        { type: 'button',  id: 'zoomout', img: 'zoomout', hint: 
_("Zoom out") },
                        { type: 'html',    id: 'zoomlevel', html: '<div 
id="zoomlevel">100%</div>'},
                        { type: 'button',  id: 'zoomin', img: 'zoomin', hint: 
_("Zoom in") }
@@ -813,23 +811,36 @@ map.on('updateparts pagenumberchanged', function (e) {
        }
 
        var toolbar = w2ui['toolbar-down'];
-       if (e.docType !== 'presentation') {
+       if (e.docType === 'presentation') {
+               toolbar.set('prev', {hint: _('Previous slide')});
+               toolbar.set('next', {hint: _('Next slide')});
+       }
+       else {
                toolbar.hide('presentation');
                toolbar.hide('insertpage');
                toolbar.hide('duplicatepage');
                toolbar.hide('deletepage');
        }
-       if (current === 0) {
-               toolbar.disable('prev');
-       }
-       else {
-               toolbar.enable('prev');
-       }
-       if (current === count - 1) {
-               toolbar.disable('next');
+
+       if (e.docType === 'spreadsheet') {
+               toolbar.hide('prev');
+               toolbar.hide('next');
+               toolbar.hide('prevnextbreak');
        }
        else {
-               toolbar.enable('next');
+               if (current === 0) {
+                       toolbar.disable('prev');
+               }
+               else {
+                       toolbar.enable('prev');
+               }
+
+               if (current === count - 1) {
+                       toolbar.disable('next');
+               }
+               else {
+                       toolbar.enable('next');
+               }
        }
 
        toolbar = w2ui['toolbar-up'];
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to