mirror of https://github.com/JustKato/FreePad.git
+ Pad Types::Downloads
This commit is contained in:
parent
6177dcecb8
commit
70b671c0be
|
@ -55,7 +55,8 @@ main#main-card {
|
|||
}
|
||||
|
||||
#textarea-preview {
|
||||
max-height: calc(20rem + 30vh);
|
||||
max-height: calc(17rem + 30vh);
|
||||
min-height: 17rem;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,8 +14,14 @@ class Pad {
|
|||
// Create a new blob of the contents of the pad
|
||||
var blob = new Blob([ document.getElementById(`pad-content`).value ], { type: "text/plain;charset=utf-8" });
|
||||
|
||||
let downloadFileName = this.title;
|
||||
if ( !this.title.includes(`.`) ) {
|
||||
// Append a default file format
|
||||
downloadFileName += `.txt`;
|
||||
}
|
||||
|
||||
// Save the blob as
|
||||
saveAs(blob, `${this.title}.txt`);
|
||||
saveAs(blob, `${downloadFileName}`);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue