diff --git a/app/scripts/locales/base.json b/app/scripts/locales/base.json index 4d8d1504..405f2348 100644 --- a/app/scripts/locales/base.json +++ b/app/scripts/locales/base.json @@ -224,6 +224,7 @@ "detAttDownload": "Shift-click the attachment button to download it or", "detAttDelToRemove": "Delete to remove", + "detAttSave": "Save as …", "detEmpty": "Your passwords will be displayed here", "detGroupRestore": "To restore this group, please drag it to any group outside trash", "detHistoryClickPoint": "Click entry history timeline point to view state", @@ -438,7 +439,7 @@ "setFileLocalHint": "Want to work seamlessly with local files?", "setFileDownloadApp": "Download a desktop app", "setFileSave": "Save", - "setFileSaveTo": "Save to ...", + "setFileSaveTo": "Save to …", "setFileClose": "Close", "setFileSync": "Sync", "setFileSyncVerb": "Sync", diff --git a/app/scripts/views/details/details-attachment-view.js b/app/scripts/views/details/details-attachment-view.js index 2e3d246a..5568f32e 100644 --- a/app/scripts/views/details/details-attachment-view.js +++ b/app/scripts/views/details/details-attachment-view.js @@ -1,14 +1,19 @@ import { View } from 'framework/views/view'; import { Shortcuts } from 'comp/app/shortcuts'; +import { Features } from 'util/features'; import template from 'templates/details/details-attachment.hbs'; class DetailsAttachmentView extends View { template = template; - events = {}; + events = { + 'click .details__attachment-preview-download-btn': 'downloadAttachment' + }; render(complete) { - super.render(); + super.render({ + isMobile: Features.isMobile + }); const shortcut = this.$el.find('.details__attachment-preview-download-text-shortcut'); shortcut.html(Shortcuts.actionShortcutSymbol(false)); const blob = new Blob([this.model.getBinary()], { type: this.model.mimeType }); @@ -36,6 +41,10 @@ class DetailsAttachmentView extends View { this.$el.find('.details__attachment-preview-icon').addClass('fa-' + this.model.icon); complete(); } + + downloadAttachment() { + this.emit('download'); + } } export { DetailsAttachmentView }; diff --git a/app/scripts/views/details/details-view.js b/app/scripts/views/details/details-view.js index e3c09f66..0500e5a4 100644 --- a/app/scripts/views/details/details-view.js +++ b/app/scripts/views/details/details-view.js @@ -545,6 +545,7 @@ class DetailsView extends View { }); subView.attId = id; subView.render(this.pageResized.bind(this)); + subView.on('download', () => this.downloadAttachment(attachment)); this.views.sub = subView; attBtn.addClass('details__attachment--active'); } diff --git a/app/styles/areas/_details.scss b/app/styles/areas/_details.scss index e3922075..443a69f0 100644 --- a/app/styles/areas/_details.scss +++ b/app/styles/areas/_details.scss @@ -560,9 +560,12 @@ } .details__attachment-preview-download-text { position: static; - margin-top: 2em; + margin-top: $large-padding; opacity: 1; } + .details__attachment-preview-buttons { + margin-top: $large-padding; + } } } diff --git a/app/templates/details/details-attachment.hbs b/app/templates/details/details-attachment.hbs index bf3d4ca4..ba516ba1 100644 --- a/app/templates/details/details-attachment.hbs +++ b/app/templates/details/details-attachment.hbs @@ -1,6 +1,12 @@
-
{{res 'detAttDownload'}}  - {{res 'detAttDelToRemove'}}
+ {{#if isMobile}} +
+ +
+ {{else}} +
{{res 'detAttDownload'}} +  {{res 'detAttDelToRemove'}}
+ {{/if}}
diff --git a/release-notes.md b/release-notes.md index 5d4bba78..f03b4e0b 100644 --- a/release-notes.md +++ b/release-notes.md @@ -5,6 +5,7 @@ Release notes `+` #1108: setting for running in an iframe `+` #963: keyboard shortcut to copy OTP in background `+` #565: global shortcut to open KeeWeb +`+` #862: downloading attachments on mobile `-` fix #1273: untranslated menu items ##### v1.11.6 (2019-10-04)