mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-04 12:22:47 +00:00 
			
		
		
		
	Add close function for Toasts
This commit is contained in:
		@@ -193,8 +193,13 @@
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      {% for message in get_flashed_messages() %}
 | 
					      {% for message in get_flashed_messages() %}
 | 
				
			||||||
      M.toast({html: '{{ message }}'})
 | 
					      M.toast({"classes": "rounded", "html": '<span>{{ message }}</span><button class="btn-flat toast-action red-text" data-action="close"><i class="material-icons">close</i></button>'});
 | 
				
			||||||
      {% endfor %}
 | 
					      {% endfor %}
 | 
				
			||||||
 | 
					      for (toastActionElement of document.querySelectorAll(".toast-action[data-action='close']")) {
 | 
				
			||||||
 | 
					        toastActionElement.addEventListener("click", function(event) {
 | 
				
			||||||
 | 
					          M.Toast.getInstance(toastActionElement.parentElement).dismiss();
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    </script>
 | 
					    </script>
 | 
				
			||||||
  </body>
 | 
					  </body>
 | 
				
			||||||
</html>
 | 
					</html>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user