diff --git a/static/css/main.css b/static/css/main.css index 4ae39e4..bba0e97 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -55,7 +55,8 @@ main#main-card { } #textarea-preview { - max-height: calc(20rem + 30vh); + max-height: calc(17rem + 30vh); + min-height: 17rem; overflow: auto; } diff --git a/static/js/pad.js b/static/js/pad.js index f32c252..0a89a9f 100644 --- a/static/js/pad.js +++ b/static/js/pad.js @@ -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}`); } } \ No newline at end of file