[Libreoffice-commits] online.git: loleaflet/src
Szymon KÅos (via logerrit)
logerrit at kemper.freedesktop.org
Wed Apr 15 08:12:09 UTC 2020
loleaflet/src/control/Control.Toolbar.js | 31 +++++++++++++++++++++++++------
1 file changed, 25 insertions(+), 6 deletions(-)
New commits:
commit 982e423140a2a30d4bddbdfa4d0cce94e0d1e4fa
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Apr 9 14:30:10 2020 +0200
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 15 10:11:52 2020 +0200
Split toolbars creation into separate methods
Change-Id: Icc5d6d26f9613ee1c3b266980614c0b0284633d9
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91976
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js
index 7af0f6ce2..efda2cb25 100644
--- a/loleaflet/src/control/Control.Toolbar.js
+++ b/loleaflet/src/control/Control.Toolbar.js
@@ -832,7 +832,7 @@ function createToolbar() {
// tablet:true means show it in normal Online from a tablet browser, and in a mobile app on a tablet
// tablet:false means hide it in normal Online used from a tablet browser, and in a mobile app on a tablet
-function initNormalToolbar() {
+function createMainToolbar() {
var toolItems = [
{type: 'button', id: 'closemobile', img: 'closemobile', desktop: false, mobile: false, tablet: true, hidden: true},
{type: 'button', id: 'save', img: 'save', hint: _UNO('.uno:Save')},
@@ -1014,8 +1014,10 @@ function initNormalToolbar() {
toolbar.bind('touchstart', function() {
w2ui['editbar'].touchStarted = true;
});
+}
- toolbar = $('#formulabar');
+function createFormulaBar() {
+ var toolbar = $('#formulabar');
toolbar.w2toolbar({
name: 'formulabar',
tooltip: 'bottom',
@@ -1043,9 +1045,11 @@ function initNormalToolbar() {
w2ui.formulabar.on('resize', function(target, e) {
e.isCancelled = true;
});
+}
+function createSigningBar() {
if (L.DomUtil.get('document-signing-bar') !== null) {
- toolbar = $('#document-signing-bar');
+ var toolbar = $('#document-signing-bar');
toolbar.w2toolbar({
name: 'document-signing-bar',
tooltip: 'bottom',
@@ -1061,8 +1065,10 @@ function initNormalToolbar() {
w2ui['document-signing-bar'].touchStarted = true;
});
}
+}
- toolbar = $('#spreadsheet-toolbar');
+function createSpreadsheetToolbar() {
+ var toolbar = $('#spreadsheet-toolbar');
toolbar.w2toolbar({
name: 'spreadsheet-toolbar',
tooltip: 'bottom',
@@ -1082,8 +1088,10 @@ function initNormalToolbar() {
toolbar.bind('touchstart', function() {
w2ui['spreadsheet-toolbar'].touchStarted = true;
});
+}
- toolbar = $('#presentation-toolbar');
+function createPresentationToolbar() {
+ var toolbar = $('#presentation-toolbar');
toolbar.w2toolbar({
name: 'presentation-toolbar',
tooltip: 'bottom',
@@ -1105,8 +1113,10 @@ function initNormalToolbar() {
toolbar.bind('touchstart', function() {
w2ui['presentation-toolbar'].touchStarted = true;
});
+}
- toolbar = $('#toolbar-down');
+function createStatusBar() {
+ var toolbar = $('#toolbar-down');
if (!window.mode.isMobile()) {
toolbar.w2toolbar({
name: 'actionbar',
@@ -1194,6 +1204,15 @@ function initNormalToolbar() {
});
}
+function initNormalToolbar() {
+ createMainToolbar();
+ createFormulaBar();
+ createSigningBar();
+ createSpreadsheetToolbar();
+ createPresentationToolbar();
+ createStatusBar();
+}
+
function setupSearchInput() {
$('#search-input').off('input', onSearchInput).on('input', onSearchInput);
$('#search-input').off('keydown', onSearchKeyDown).on('keydown', onSearchKeyDown);
More information about the Libreoffice-commits
mailing list