mirror of
				https://github.com/Frooodle/Stirling-PDF.git
				synced 2025-10-25 11:17:28 +02:00 
			
		
		
		
	Merge pull request #615 from mannam11/added-remove-button-529
added a remove button issue#529
This commit is contained in:
		
						commit
						279cfa70f5
					
				| @ -20,6 +20,7 @@ function displayFiles(files) { | |||||||
|                 <div class="arrows d-flex"> |                 <div class="arrows d-flex"> | ||||||
|                     <button class="btn btn-secondary move-up"><span>↑</span></button> |                     <button class="btn btn-secondary move-up"><span>↑</span></button> | ||||||
|                     <button class="btn btn-secondary move-down"><span>↓</span></button> |                     <button class="btn btn-secondary move-down"><span>↓</span></button> | ||||||
|  |                     <button class="btn btn-danger remove-file"><span>×</span></button> | ||||||
|                 </div> |                 </div> | ||||||
|             </div> |             </div> | ||||||
|         `;
 |         `;
 | ||||||
| @ -55,6 +56,16 @@ function attachMoveButtons() { | |||||||
|             } |             } | ||||||
|         }); |         }); | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|  |     var removeButtons = document.querySelectorAll(".remove-file"); | ||||||
|  |     for (var i = 0; i < removeButtons.length; i++) { | ||||||
|  |          removeButtons[i].addEventListener("click", function (event) { | ||||||
|  |               event.preventDefault(); | ||||||
|  |               var parent = this.closest(".list-group-item"); | ||||||
|  |               parent.remove(); | ||||||
|  |               updateFiles(); | ||||||
|  |          }); | ||||||
|  |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| document.getElementById("sortByNameBtn").addEventListener("click", function() { | document.getElementById("sortByNameBtn").addEventListener("click", function() { | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user