Move function html_to_element to common.js.
This commit is contained in:
		
							parent
							
								
									2ba9eb8df2
								
							
						
					
					
						commit
						113a92fb5b
					
				
					 2 changed files with 9 additions and 8 deletions
				
			
		|  | @ -106,6 +106,14 @@ function entry_with_history_hook(box, button) | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | common.html_to_element = | ||||||
|  | function html_to_element(html) | ||||||
|  | { | ||||||
|  |     var template = document.createElement("template"); | ||||||
|  |     template.innerHTML = html; | ||||||
|  |     return template.content.firstChild; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| common.init_atag_merge_params = | common.init_atag_merge_params = | ||||||
| function init_atag_merge_params() | function init_atag_merge_params() | ||||||
| { | { | ||||||
|  |  | ||||||
|  | @ -310,7 +310,7 @@ function toggle_embed_video(video_id) | ||||||
|     if (embeds.length == 0) |     if (embeds.length == 0) | ||||||
|     { |     { | ||||||
|         var html = `<div class="video_iframe_holder"><iframe width="711" height="400" src="https://www.youtube.com/embed/${video_id}" frameborder="0" allow="encrypted-media" allowfullscreen></iframe></div>` |         var html = `<div class="video_iframe_holder"><iframe width="711" height="400" src="https://www.youtube.com/embed/${video_id}" frameborder="0" allow="encrypted-media" allowfullscreen></iframe></div>` | ||||||
|         var embed = html_to_element(html); |         var embed = common.html_to_element(html); | ||||||
|         embed_toolbox.appendChild(embed); |         embed_toolbox.appendChild(embed); | ||||||
|         show_button.classList.add("hidden"); |         show_button.classList.add("hidden"); | ||||||
|         hide_button.classList.remove("hidden"); |         hide_button.classList.remove("hidden"); | ||||||
|  | @ -333,13 +333,6 @@ function deselect_all() | ||||||
|     video_card_selections = []; |     video_card_selections = []; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function html_to_element(html) |  | ||||||
| { |  | ||||||
|     var template = document.createElement("template"); |  | ||||||
|     template.innerHTML = html; |  | ||||||
|     return template.content.firstChild; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| function onclick_select(event) | function onclick_select(event) | ||||||
| { | { | ||||||
|     if (!event.target.classList.contains("video_card")) |     if (!event.target.classList.contains("video_card")) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue