Merge branch '608-fix-pdf-download-issue' into 'dev'
Fix PDF download issue Closes #608 See merge request keanuapp/keanuapp-weblite!376
This commit is contained in:
commit
244d23f31e
1 changed files with 4 additions and 7 deletions
|
|
@ -858,7 +858,7 @@ class Util {
|
||||||
*/
|
*/
|
||||||
makeUniqueAvatar(image) {
|
makeUniqueAvatar(image) {
|
||||||
var list = png.splitChunk(image);
|
var list = png.splitChunk(image);
|
||||||
|
|
||||||
// append
|
// append
|
||||||
var iend = list.pop(); // remove IEND
|
var iend = list.pop(); // remove IEND
|
||||||
var newchunk = png.createChunk("tEXt","Comment\0Keanu avatar - " + this.randomPass());
|
var newchunk = png.createChunk("tEXt","Comment\0Keanu avatar - " + this.randomPass());
|
||||||
|
|
@ -882,7 +882,7 @@ class Util {
|
||||||
onlyContentUri: false,
|
onlyContentUri: false,
|
||||||
};
|
};
|
||||||
let data = response.data;
|
let data = response.data;
|
||||||
|
|
||||||
// If making a system unique avatar, we add a random PNG header in here
|
// If making a system unique avatar, we add a random PNG header in here
|
||||||
if (makeUnique) {
|
if (makeUnique) {
|
||||||
data = this.makeUniqueAvatar(data);
|
data = this.makeUniqueAvatar(data);
|
||||||
|
|
@ -1069,7 +1069,7 @@ class Util {
|
||||||
if (match) {
|
if (match) {
|
||||||
// Extract components and convert to numbers. Note that months are 0-indexed.
|
// Extract components and convert to numbers. Note that months are 0-indexed.
|
||||||
const year = parseInt(match[1], 10);
|
const year = parseInt(match[1], 10);
|
||||||
const month = parseInt(match[2], 10) - 1;
|
const month = parseInt(match[2], 10) - 1;
|
||||||
const day = parseInt(match[3], 10);
|
const day = parseInt(match[3], 10);
|
||||||
const hour = parseInt(match[4], 10);
|
const hour = parseInt(match[4], 10);
|
||||||
const minute = parseInt(match[5], 10);
|
const minute = parseInt(match[5], 10);
|
||||||
|
|
@ -1139,10 +1139,7 @@ class Util {
|
||||||
const link = document.createElement("a");
|
const link = document.createElement("a");
|
||||||
link.href = url;
|
link.href = url;
|
||||||
link.target = "_blank";
|
link.target = "_blank";
|
||||||
if (!this.isFileTypePDF(event)) {
|
link.download = event.getContent().body || this.$t("fallbacks.download_name");
|
||||||
// PDFs are shown inline, not downloaded
|
|
||||||
link.download = event.getContent().body || this.$t("fallbacks.download_name");
|
|
||||||
}
|
|
||||||
console.log("LINK", link);
|
console.log("LINK", link);
|
||||||
document.body.appendChild(link);
|
document.body.appendChild(link);
|
||||||
link.click();
|
link.click();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue