diff options
author | Mert Tumer <mert.tumer@collabora.com> | 2021-10-27 15:53:13 +0300 |
---|---|---|
committer | Mert Tumer <mert.tumer@collabora.com> | 2021-11-04 10:07:52 +0300 |
commit | b4fcb63a43563869ae130f798bec01657ff75239 (patch) | |
tree | 023edee6f27691c110847e54f9c7337471a55975 /loleaflet | |
parent | android: Attempt to fix modification time issue (diff) | |
download | online-b4fcb63a43563869ae130f798bec01657ff75239.tar.gz online-b4fcb63a43563869ae130f798bec01657ff75239.zip |
mobile: Fix hidden blue edit button on readonly files
We display the edit button on mobile and offer save-as
to allow editing
Except for PDF
Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: Iee4590704bb38880b39d00f6973559f68b96b781
Diffstat (limited to 'loleaflet')
-rw-r--r-- | loleaflet/src/control/Permission.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/loleaflet/src/control/Permission.js b/loleaflet/src/control/Permission.js index 262b0e46ca..4840daa270 100644 --- a/loleaflet/src/control/Permission.js +++ b/loleaflet/src/control/Permission.js @@ -7,11 +7,22 @@ L.Map.include({ setPermission: function (perm) { var button = $('#mobile-edit-button'); button.off('click'); - button.hide(); + // app.file.fileBasedView is new view that has continuous scrolling + // used for PDF and we dont permit editing for PDFs + // this._isFilePlainText() is a check for plain text files and even on desktop browser + // we warn the user about loosing the rich formatting and offer an option to + // save as ODF instead of plain text format + // + // For mobile we need to display the edit button for all the cases except for PDF + // we offer save-as to another place where the user can edit the document + if (!app.file.fileBasedView && (this._isFilePlainText() || window.mode.isMobile() || window.mode.isTablet())) { + button.show(); + } else { + button.hide(); + } var that = this; if (perm === 'edit') { if (this._isFilePlainText() || window.mode.isMobile() || window.mode.isTablet()) { - button.show(); button.on('click', function () { that._switchToEditMode(); }); |