Skip to content

Business intelligence made simple

Moved js to external file

Andrew Kaned7e32aa97449
diff --git a/app/assets/javascripts/blazer/application.js b/app/assets/javascripts/blazer/application.js
index cbd8ce99..4c330d7b 100644
--- a/app/assets/javascripts/blazer/application.js
+++ b/app/assets/javascripts/blazer/application.js
@@ -29,6 +29,10 @@ $(document).on("submit", "form[method=get]", function() {
return false;
});
+$(document).on("change", "#bind input, #bind select", function () {
+ submitIfCompleted($(this).closest("form"));
+});
+
function uuid() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
diff --git a/app/views/blazer/dashboards/show.html.erb b/app/views/blazer/dashboards/show.html.erb
index f0480ce4..a321b08a 100644
--- a/app/views/blazer/dashboards/show.html.erb
+++ b/app/views/blazer/dashboards/show.html.erb
@@ -45,9 +45,3 @@
});
</script>
<% end %>
-
-<script>
- $(".form-inline input, .form-inline select").change( function () {
- submitIfCompleted($(this).closest("form"));
- });
-</script>
diff --git a/app/views/blazer/queries/show.html.erb b/app/views/blazer/queries/show.html.erb
index 7f4c2174..9f311b81 100644
--- a/app/views/blazer/queries/show.html.erb
+++ b/app/views/blazer/queries/show.html.erb
@@ -77,9 +77,3 @@
}
</script>
<% end %>
-
-<script>
- $(".form-inline input, .form-inline select").change( function () {
- submitIfCompleted($(this).closest("form"));
- });
-</script>