Skip to content

Business intelligence made simple

Fix for creating dashboards

Andrew2744297bd60e
diff --git a/app/views/blazer/dashboards/_form.html.erb b/app/views/blazer/dashboards/_form.html.erb
index cd9796eb..d42e31d8 100644
--- a/app/views/blazer/dashboards/_form.html.erb
+++ b/app/views/blazer/dashboards/_form.html.erb
@@ -34,21 +34,19 @@ li:hover .glyphicon-remove {
<div class="form-group">
<%= f.label :query_id, "Add Chart" %>
<div class="hide">
- <%= select_tag :query_id, options_for_select(Blazer::Query.order(:name).map { |q| [q.name, q.id] }, {include_blank: true}) %>
+ <%= select_tag :query_id, options_for_select(Blazer::Query.order(:name).map { |q| [q.name, q.id] }), {include_blank: true, placeholder: "Select chart"} %>
</div>
<script>
- $("#query_id").selectize({allowEmptyOption: true}).parents(".hide").removeClass("hide");
+ $("#query_id").selectize().parents(".hide").removeClass("hide");
$("#query_id").change( function () {
var $option = $(this).find("option:selected");
if ($option.val() !== "") {
- // console.log($option.val());
- // console.log($option.text());
var $li = $("<li></li>");
$li.addClass("list-group-item");
$li.text($option.text());
$li.prepend('<span class="glyphicon glyphicon-remove" aria-hidden="true" style="float: right; margin-top: 3px;"></span><input type="hidden" name="query_ids[]" id="query_ids_" value="' + $option.val() + '">');
$(".list-group").append($li);
- $(this).val("");
+ $(this)[0].selectize.setValue("");
$(".form-group").removeClass("hide");
}
});