mirror of
				https://github.com/Frooodle/Stirling-PDF.git
				synced 2025-10-25 11:17:28 +02:00 
			
		
		
		
	Adds support for disabled filename input if not pdf is loaded. Need to disable the input if all pages are deleted.
This commit is contained in:
		
							parent
							
								
									323745e61f
								
							
						
					
					
						commit
						74da8c340d
					
				| @ -35,6 +35,7 @@ class PdfContainer { | |||||||
| 
 | 
 | ||||||
|         const filenameInput = document.getElementById('filename-input'); |         const filenameInput = document.getElementById('filename-input'); | ||||||
|         filenameInput.onkeyup = this.updateFilename; |         filenameInput.onkeyup = this.updateFilename; | ||||||
|  |         filenameInput.disabled = true; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     movePageTo(startElement, endElement, scrollTo = false) { |     movePageTo(startElement, endElement, scrollTo = false) { | ||||||
| @ -67,6 +68,10 @@ class PdfContainer { | |||||||
|         input.setAttribute("accept", "application/pdf"); |         input.setAttribute("accept", "application/pdf"); | ||||||
|         input.onchange = async(e) => { |         input.onchange = async(e) => { | ||||||
|             const files = e.target.files; |             const files = e.target.files; | ||||||
|  |             if (files.length > 0) { | ||||||
|  |                 const filenameInput = document.getElementById('filename-input'); | ||||||
|  |                 filenameInput.disabled = false; | ||||||
|  |             } | ||||||
|             this.addPdfsFromFiles(files, nextSiblingElement); |             this.addPdfsFromFiles(files, nextSiblingElement); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| @ -224,7 +229,6 @@ class PdfContainer { | |||||||
|     setDownloadAttribute() { |     setDownloadAttribute() { | ||||||
|         console.log('inside setDownloadAttribute ' + this.filename); |         console.log('inside setDownloadAttribute ' + this.filename); | ||||||
|         this.downloadLink.setAttribute("download", this.filename); |         this.downloadLink.setAttribute("download", this.filename); | ||||||
|         console.log('downloadLink download 2 ' + a.download); |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     updateFilename() { |     updateFilename() { | ||||||
|  | |||||||
| @ -132,6 +132,10 @@ | |||||||
|         #global-buttons-container input::placeholder { |         #global-buttons-container input::placeholder { | ||||||
|             color: #ffffff; |             color: #ffffff; | ||||||
|         } |         } | ||||||
|  | 
 | ||||||
|  |         #global-buttons-container input:disabled { | ||||||
|  |             color: #3D3D3D !important; | ||||||
|  |         } | ||||||
|         #global-buttons-container svg { |         #global-buttons-container svg { | ||||||
|             width: 20px; |             width: 20px; | ||||||
|             height: 20px; |             height: 20px; | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user