mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 02:44:18 +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);
|
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 @@
|
|||||||
|
|
||||||
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"];
|
||||||
|
Loading…
Reference in New Issue
Block a user