Skip to content

Business intelligence made simple

Reduced jQuery on dashboard form [skip ci]

Andrew Kane453237c2bb67
diff --git a/app/views/blazer/dashboards/_form.html.erb b/app/views/blazer/dashboards/_form.html.erb
index 3d0be73c..aa3889ae 100644
--- a/app/views/blazer/dashboards/_form.html.erb
+++ b/app/views/blazer/dashboards/_form.html.erb
@@ -56,11 +56,13 @@
addQuery(dashboardQueries[i])
}
- $(queriesList).on("click", ".glyphicon-remove", function () {
- this.closest("li").remove()
+ queriesList.addEventListener("click", function (e) {
+ if (e.target.classList.contains("glyphicon-remove")) {
+ e.target.closest("li").remove()
- if (queriesList.querySelectorAll("li").length == 0) {
- queriesGroup.hide()
+ if (queriesList.querySelectorAll("li").length == 0) {
+ queriesGroup.classList.add("hide")
+ }
}
})