Port upstream's javascript to the error page
This commit is contained in:
		
							parent
							
								
									369a475a70
								
							
						
					
					
						commit
						9a47f2cbdf
					
				
					 2 changed files with 14 additions and 1 deletions
				
			
		
							
								
								
									
										13
									
								
								app/javascript/flavours/glitch/packs/error.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								app/javascript/flavours/glitch/packs/error.js
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,13 @@
 | 
				
			||||||
 | 
					import ready from 'flavours/glitch/util/ready';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ready(() => {
 | 
				
			||||||
 | 
					  const image = document.querySelector('img');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  image.addEventListener('mouseenter', () => {
 | 
				
			||||||
 | 
					    image.src = '/oops.gif';
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  image.addEventListener('mouseleave', () => {
 | 
				
			||||||
 | 
					    image.src = '/oops.png';
 | 
				
			||||||
 | 
					  });
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
| 
						 | 
					@ -7,7 +7,7 @@ pack:
 | 
				
			||||||
    filename: packs/common.js
 | 
					    filename: packs/common.js
 | 
				
			||||||
    stylesheet: true
 | 
					    stylesheet: true
 | 
				
			||||||
  embed: packs/public.js
 | 
					  embed: packs/public.js
 | 
				
			||||||
  error:
 | 
					  error: packs/error.js
 | 
				
			||||||
  home:
 | 
					  home:
 | 
				
			||||||
    filename: packs/home.js
 | 
					    filename: packs/home.js
 | 
				
			||||||
    preload:
 | 
					    preload:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue