Skip to content
Snippets Groups Projects
Commit cc527441 authored by Stephan Porada's avatar Stephan Porada :speech_balloon:
Browse files

Add cheese to all toasts.

parent e5928731
No related branches found
No related tags found
No related merge requests found
...@@ -233,13 +233,7 @@ ...@@ -233,13 +233,7 @@
socket.emit("corpus_analysis", queryData); socket.emit("corpus_analysis", queryData);
queryLoadingElement.classList.remove("hide"); queryLoadingElement.classList.remove("hide");
queryResultsTableElement.classList.add("hide"); queryResultsTableElement.classList.add("hide");
let toast = M.toast({"html": `<span>Query has been sent!</span><button class="btn-flat toast-action red-text" data-action="close"><i class="material-icons">close</i></button>`}); toast("Query has been sent!")
let toastActionElement = toast.el.querySelector(".toast-action[data-action='close']");
if (toastActionElement) {
toastActionElement.addEventListener("click", function() {
toast.dismiss();
});
}
}); });
socket.on("corpus_analysis", function(message) { socket.on("corpus_analysis", function(message) {
...@@ -256,23 +250,11 @@ ...@@ -256,23 +250,11 @@
if (message === null) { if (message === null) {
queryResultsTableElement.classList.add("hide"); queryResultsTableElement.classList.add("hide");
let toast = M.toast({"classes": "red", "html": `<span>No results for this query!</span><button class="btn-flat toast-action white-text" data-action="close"><i class="material-icons">close</i></button>`}); toast("No results for this query!")
let toastActionElement = toast.el.querySelector(".toast-action[data-action='close']");
if (toastActionElement) {
toastActionElement.addEventListener("click", function() {
toast.dismiss();
});
}
return; return;
} else if (message === "CQI_CQP_ERROR_GENERAL") { } else if (message === "CQI_CQP_ERROR_GENERAL") {
queryResultsTableElement.classList.add("hide"); queryResultsTableElement.classList.add("hide");
let toast = M.toast({"classes": "red", "html": `<span>Invalid query entered!</span><button class="btn-flat toast-action white-text" data-action="close"><i class="material-icons">close</i></button>`}); toast("Invalid query entered!", "red");
let toastActionElement = toast.el.querySelector(".toast-action[data-action='close']");
if (toastActionElement) {
toastActionElement.addEventListener("click", function() {
toast.dismiss();
});
}
return; return;
} else { } else {
total_nr_matches = message["total_nr_matches"]; total_nr_matches = message["total_nr_matches"];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment