loleaflet/dist/spreadsheet.css    |   10 ++---
 loleaflet/dist/toolbar/toolbar.js |   71 ++++++++++++++++++++++++++++++++++++--
 2 files changed, 73 insertions(+), 8 deletions(-)

New commits:
commit 1864491e235b3eb06f606d7db88be604c56cca92
Author: Pranav Kant <pran...@collabora.com>
Date:   Fri May 6 13:59:21 2016 +0530

    loleaflet: Enable/Disable buttons for edit/view modes, ccu#1768
    
    Change-Id: Id14ef66adb9bda33246625d89c093cb88927f2bb

diff --git a/loleaflet/dist/toolbar/toolbar.js 
b/loleaflet/dist/toolbar/toolbar.js
index 96541a3..fbbaa33 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -176,9 +176,9 @@ $(function () {
 });
 
 var formatButtons = ['undo', 'redo', 'save',
-                                        'bold', 'italic', 'underline', 
'strikeout',
-                                        'fontcolor', 'backcolor', 'bullet', 
'numbering', 'alignleft', 'alignhorizontal', 'alignright', 'alignblock',
-                                        'incrementindent', 'decrementindent', 
'insertgraphic'];
+                     'bold', 'italic', 'underline', 'strikeout',
+                     'fontcolor', 'backcolor', 'bullet', 'numbering', 
'alignleft', 'alignhorizontal', 'alignright', 'alignblock',
+                     'incrementindent', 'decrementindent', 'insertgraphic'];
 
 var takeEditPopupMessage = '<div>You are viewing now.<br/>Click here to take 
edit</div>';
 var takeEditPopupTimeout = null;
@@ -919,6 +919,71 @@ map.on('editlock', function (e) {
                        toolbar.disable(id);
                }
        });
+
+       var spreadsheetButtons = ['firstrecord', 'prevrecord', 'nextrecord', 
'lastrecord'];
+       var formulaBarButtons = ['sum', 'function'];
+       var presentationButtons = ['insertpage', 'duplicatepage', 'deletepage'];
+       var toolbarDownButtons = ['next', 'prev'];
+       if (e.value) {
+               // Enable list boxes
+               $('.styles-select').prop('disabled', false);
+               $('.fonts-select').prop('disabled', false);
+               $('.fontsizes-select').prop('disabled', false);
+
+               // Enable formula bar
+               $('#formulaInput').prop('disabled', false);
+               toolbar = w2ui['formulabar'];
+               formulaBarButtons.forEach(function(id) {
+                       toolbar.enable(id);
+               });
+
+               toolbar = w2ui['spreadsheet-toolbar'];
+               spreadsheetButtons.forEach(function(id) {
+                       toolbar.enable(id);
+               });
+
+               toolbar = w2ui['presentation-toolbar'];
+               presentationButtons.forEach(function(id) {
+                       toolbar.enable(id);
+               });
+
+               toolbar = w2ui['toolbar-down'];
+               toolbarDownButtons.forEach(function(id) {
+                       toolbar.enable(id);
+               });
+               $('#search-input').prop('disabled', false);
+       }
+       else {
+               // Disable list boxes
+               $('.styles-select').prop('disabled', true);
+               $('.fonts-select').prop('disabled', true);
+               $('.fontsizes-select').prop('disabled', true);
+
+               // Disable formula bar
+               $('#formulaInput').prop('disabled', true);
+
+               toolbar = w2ui['formulabar'];
+               formulaBarButtons.forEach(function(id) {
+                       toolbar.disable(id);
+               });
+
+               toolbar = w2ui['spreadsheet-toolbar'];
+               spreadsheetButtons.forEach(function(id) {
+                       toolbar.disable(id);
+               });
+
+               toolbar = w2ui['presentation-toolbar'];
+               presentationButtons.forEach(function(id) {
+                       toolbar.disable(id);
+               });
+
+               toolbar = w2ui['toolbar-down'];
+               toolbarDownButtons.forEach(function(id) {
+                       toolbar.disable(id);
+               });
+               $('#search-input').prop('disabled', true);
+       }
+
 });
 
 map.on('mouseup keypress', function(e) {
commit 2d69745d2cfa3428a903512247a890b8cec74b2e
Author: Pranav Kant <pran...@collabora.com>
Date:   Fri May 6 13:06:26 2016 +0530

    loleaflet: Use tabs consistently
    
    Change-Id: I1d24ba1c8956a919eb02347dfc379927f536173e

diff --git a/loleaflet/dist/spreadsheet.css b/loleaflet/dist/spreadsheet.css
index 774a366..53f8806 100644
--- a/loleaflet/dist/spreadsheet.css
+++ b/loleaflet/dist/spreadsheet.css
@@ -45,8 +45,8 @@
        }
 
 .spreadsheet-context-menu-selected {
-       background: white !important;
-       color: black !important;
+       background: white !important;
+       color: black !important;
        border-top: 1px solid lightgrey;
        border-left: 1px solid lightgrey;
        border-right: 1px solid lightgrey;
@@ -54,8 +54,8 @@
        }
 
 .spreadsheet-context-menu.context-menu-disabled {
-        color: grey;
-        }
+       color: grey;
+       }
 
 .spreadsheet-header-corner {
        border-top: 1px solid darkgrey;
@@ -171,5 +171,5 @@
        }
 
 .spreadsheet-header-row:hover {
-        background-color: #DDD;
+       background-color: #DDD;
        }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to