Skip to content

Business intelligence made simple

Faster preview

Andrew Kane6354eda35c9a
diff --git a/app/views/blazer/queries/_form.html.erb b/app/views/blazer/queries/_form.html.erb
index 66c31c23..6c1d0749 100644
--- a/app/views/blazer/queries/_form.html.erb
+++ b/app/views/blazer/queries/_form.html.erb
@@ -20,6 +20,15 @@
</div>
<%= f.select :data_source, Blazer.data_sources.values.map { |ds| [ds.name, ds.id] }, {}, class: ("hide" if Blazer.data_sources.size == 1), style: "width: 140px;" %>
<div id="tables" style="display: inline-block; width: 260px; margin-right: 10px;"></div>
+ <script>
+ function updatePreviewSelect() {
+ $("#tables").load("<%= tables_queries_path %>?" + $.param({data_source: $("#query_data_source").val()}), function () {
+ $("#table_names").selectize({});
+ });
+ }
+ updatePreviewSelect();
+ $("#query_data_source").selectize().change(updatePreviewSelect);
+ </script>
<%= link_to "Run", "#", class: "btn btn-info", id: "run", style: "vertical-align: top;" %>
</div>
</div>
@@ -129,14 +138,6 @@
}
});
- function updatePreviewSelect() {
- $("#tables").load("<%= tables_queries_path %>?" + $.param({data_source: $("#query_data_source").val()}), function () {
- $("#table_names").selectize({});
- });
- }
- updatePreviewSelect();
- $("#query_data_source").selectize().change(updatePreviewSelect);
-
$("form.the_form").on("submit", function() {
$("#query_statement").val(editor.getValue());
return true;