[Libreoffice-commits] online.git: loleaflet/src
gokaysatir (via logerrit)
logerrit at kemper.freedesktop.org
Thu Sep 24 14:54:49 UTC 2020
loleaflet/src/control/Parts.js | 41 ++++++++++++++++++++++++++++++++++++++++-
1 file changed, 40 insertions(+), 1 deletion(-)
New commits:
commit b8025ec431226fe3a3d19ec46b660978edf2c1b9
Author: gokaysatir <gokaysatir at collabora.com>
AuthorDate: Wed Sep 23 17:10:56 2020 +0300
Commit: Henry Castro <hcastro at collabora.com>
CommitDate: Thu Sep 24 16:54:27 2020 +0200
Loleaflet: Show sheet feature is enabled also for mobile.
Change-Id: I60dd7354ee5e54c00e8ea78f93d15b34ab5c1fda
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103259
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Tested-by: Henry Castro <hcastro at collabora.com>
Reviewed-by: Henry Castro <hcastro at collabora.com>
diff --git a/loleaflet/src/control/Parts.js b/loleaflet/src/control/Parts.js
index 427a3238f..0e52e7472 100644
--- a/loleaflet/src/control/Parts.js
+++ b/loleaflet/src/control/Parts.js
@@ -2,6 +2,9 @@
/*
* Document parts switching and selecting handler
*/
+
+/* global vex */
+
L.Map.include({
setPart: function (part, external, calledFromSetPartHandler) {
var docLayer = this._docLayer;
@@ -345,7 +348,43 @@ L.Map.include({
showPage: function () {
if (this.getDocType() === 'spreadsheet' && this.hasAnyHiddenPart()) {
- this._socket.sendMessage('uno .uno:Show');
+ var partNames_ = this._docLayer._partNames;
+ var hiddenParts_ = this._docLayer._hiddenParts;
+
+ if (hiddenParts_.length > 0) {
+ var container = document.createElement('div');
+ container.style.maxHeight = '300px';
+ container.style.maxWidth = '200px';
+ for (var i = 0; i < hiddenParts_.length; i++) {
+ var checkbox = document.createElement('input');
+ checkbox.type = 'checkbox';
+ checkbox.id = 'hidden-part-checkbox-' + String(hiddenParts_[i]);
+ var label = document.createElement('label');
+ label.htmlFor = 'hidden-part-checkbox-' + String(hiddenParts_[i]);
+ label.innerText = partNames_[hiddenParts_[i]];
+ var newLine = document.createElement('br');
+ container.appendChild(checkbox);
+ container.appendChild(label);
+ container.appendChild(newLine);
+ }
+ }
+
+ var socket_ = this._socket;
+ vex.dialog.confirm({
+ unsafeMessage: container.outerHTML,
+ callback: function (value) {
+ if (value === true) {
+ var checkboxList = document.querySelectorAll('input[id^="hidden-part-checkbox"]');
+ for (var i = 0; i < checkboxList.length; i++) {
+ if (checkboxList[i].checked === true) {
+ var partName_ = partNames_[parseInt(checkboxList[i].id.replace('hidden-part-checkbox-', ''))];
+ var argument = {aTableName: {type: 'string', value: partName_}};
+ socket_.sendMessage('uno .uno:Show ' + JSON.stringify(argument));
+ }
+ }
+ }
+ }
+ });
}
},
More information about the Libreoffice-commits
mailing list