[Libreoffice-commits] online.git: loleaflet/css loleaflet/src
Henry Castro (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jul 7 15:29:59 UTC 2020
loleaflet/css/device-mobile.css | 6 +++---
loleaflet/src/control/Control.PartsPreview.js | 15 ++++++++++-----
2 files changed, 13 insertions(+), 8 deletions(-)
New commits:
commit e5188272c768e3cb4da8f87f93fd06a510d2f930
Author: Henry Castro <hcastro at collabora.com>
AuthorDate: Thu Jun 11 09:35:25 2020 -0400
Commit: Henry Castro <hcastro at collabora.com>
CommitDate: Tue Jul 7 17:29:32 2020 +0200
android: fix thumbnails images when portrait orientation is set
Change-Id: I70aee6b569f78795487cbff736130e0e7413e852
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96123
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Henry Castro <hcastro at collabora.com>
diff --git a/loleaflet/css/device-mobile.css b/loleaflet/css/device-mobile.css
index 24f26678a..2207215ac 100644
--- a/loleaflet/css/device-mobile.css
+++ b/loleaflet/css/device-mobile.css
@@ -584,14 +584,14 @@ td[id^=tb_spreadsheet-toolbar_item]:focus table.w2ui-button div.w2ui-icon, td[id
/* Related to slidesorter */
/* Show slidesorter beyond 768px only */
#presentation-controls-wrapper {
- top: initial;
+ top: 41px;
left: initial;
bottom: 33px;
max-width: initial;
}
#presentation-controls-wrapper.readonly {
- top: initial;
+ top: 41px;
bottom: 0px;
}
@@ -691,7 +691,6 @@ td[id^=tb_spreadsheet-toolbar_item]:focus table.w2ui-button div.w2ui-icon, td[id
.preview-img-portrait {
min-width: 37px;
max-width: 60px;
- max-height: 45px;
margin: 0px;
}
@@ -715,6 +714,7 @@ td[id^=tb_spreadsheet-toolbar_item]:focus table.w2ui-button div.w2ui-icon, td[id
}
#document-container.landscape.parts-preview-document {
+ top: 41px;
left: 66px !important;
bottom: 33px;
}
diff --git a/loleaflet/src/control/Control.PartsPreview.js b/loleaflet/src/control/Control.PartsPreview.js
index e5f1676df..a922ada7a 100644
--- a/loleaflet/src/control/Control.PartsPreview.js
+++ b/loleaflet/src/control/Control.PartsPreview.js
@@ -12,8 +12,8 @@ L.Control.PartsPreview = L.Control.extend({
frameClass: '',
axis: '',
allowOrientation: true,
- maxWidth: (window.mode.isMobile() || window.mode.isTablet()) ? 60 : 180,
- maxHeight: (window.mode.isMobile() || window.mode.isTablet()) ? 60 : 180
+ maxWidth: !window.mode.isDesktop() ? 60 : 180,
+ maxHeight: !window.mode.isDesktop() ? 60 : 180
},
partsFocused: false,
@@ -118,7 +118,7 @@ L.Control.PartsPreview = L.Control.extend({
this._addDnDHandlers(frame);
frame.setAttribute('draggable', false);
- if (!window.mode.isMobile()) {
+ if (window.mode.isDesktop()) {
L.DomUtil.setStyle(frame, 'height', '20px');
L.DomUtil.setStyle(frame, 'margin', '0em');
}
@@ -204,7 +204,7 @@ L.Control.PartsPreview = L.Control.extend({
img.hash = hashCode;
img.src = L.Icon.Default.imagePath + '/preview_placeholder.png';
img.fetched = false;
- if (window.mode.isMobile() || window.mode.isTablet()) {
+ if (!window.mode.isDesktop()) {
(new Hammer(img, {recognizers: [[Hammer.Press]]}))
.on('press', L.bind(function () {
if (this._map._permission === 'edit') {
@@ -290,7 +290,7 @@ L.Control.PartsPreview = L.Control.extend({
var previewImgMinWidth = Math.round(parseFloat(L.DomUtil.getStyle(img, 'min-width')));
var imgHeight = imgSize.height;
var imgWidth = imgSize.width;
- if (imgSize.width < previewImgMinWidth)
+ if (imgSize.width < previewImgMinWidth && window.mode.isDesktop())
imgHeight = Math.round(imgHeight * previewImgMinWidth / imgSize.width);
var previewFrameBB = img.parentElement.getBoundingClientRect();
if (this._direction === 'x') {
@@ -303,6 +303,11 @@ L.Control.PartsPreview = L.Control.extend({
this._previewFrameHeight = imgHeight + 2 * previewImgBorder;
}
}
+
+ if (!window.mode.isDesktop() && imgSize) {
+ L.DomUtil.setStyle(img, 'width', imgSize.width + 'px');
+ L.DomUtil.setStyle(img, 'height', imgSize.height + 'px');
+ }
},
_setPart: function (e) {
More information about the Libreoffice-commits
mailing list