mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 01:05:42 +00:00
Add cheese to all toasts.
This commit is contained in:
parent
e5928731ec
commit
cc52744109
@ -233,13 +233,7 @@
|
||||
socket.emit("corpus_analysis", queryData);
|
||||
queryLoadingElement.classList.remove("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>`});
|
||||
let toastActionElement = toast.el.querySelector(".toast-action[data-action='close']");
|
||||
if (toastActionElement) {
|
||||
toastActionElement.addEventListener("click", function() {
|
||||
toast.dismiss();
|
||||
});
|
||||
}
|
||||
toast("Query has been sent!")
|
||||
});
|
||||
|
||||
socket.on("corpus_analysis", function(message) {
|
||||
@ -256,23 +250,11 @@
|
||||
|
||||
if (message === null) {
|
||||
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>`});
|
||||
let toastActionElement = toast.el.querySelector(".toast-action[data-action='close']");
|
||||
if (toastActionElement) {
|
||||
toastActionElement.addEventListener("click", function() {
|
||||
toast.dismiss();
|
||||
});
|
||||
}
|
||||
toast("No results for this query!")
|
||||
return;
|
||||
} else if (message === "CQI_CQP_ERROR_GENERAL") {
|
||||
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>`});
|
||||
let toastActionElement = toast.el.querySelector(".toast-action[data-action='close']");
|
||||
if (toastActionElement) {
|
||||
toastActionElement.addEventListener("click", function() {
|
||||
toast.dismiss();
|
||||
});
|
||||
}
|
||||
toast("Invalid query entered!", "red");
|
||||
return;
|
||||
} else {
|
||||
total_nr_matches = message["total_nr_matches"];
|
||||
|
Loading…
Reference in New Issue
Block a user