diff --git a/dashed/assets/javascripts/dashboard.js b/dashed/assets/javascripts/dashboard.js index d5768df0568..b5b7d0dcffb 100644 --- a/dashed/assets/javascripts/dashboard.js +++ b/dashed/assets/javascripts/dashboard.js @@ -51,14 +51,12 @@ var Dashboard = function (dashboardData) { return JSON.stringify(this.filters, null, 4); }, refreshExcept: function (slice_id) { - var immune = this.metadata.filter_immune_slices; - if (immune) { - this.slices.forEach(function (slice) { - if (slice.data.slice_id !== slice_id && immune.indexOf(slice.data.slice_id) === -1) { - slice.render(); - } - }); - } + var immune = this.metadata.filter_immune_slice || []; + this.slices.forEach(function (slice) { + if (slice.data.slice_id !== slice_id && immune.indexOf(slice.data.slice_id) === -1) { + slice.render(); + } + }); }, clearFilters: function (slice_id) { delete this.filters[slice_id]; @@ -79,11 +77,12 @@ var Dashboard = function (dashboardData) { this.refreshExcept(slice_id); }, getSlice: function (slice_id) { - this.slices.forEach(function (slice, i) { - if (slice.slice_id === slice_id) { - return slice; + slice_id = parseInt(slice_id, 10); + for (var i=0; i < this.slices.length; i++) { + if (this.slices[i].data.slice_id === slice_id) { + return this.slices[i]; } - }); + } }, initDashboardView: function () { dashboard = this; @@ -97,10 +96,7 @@ var Dashboard = function (dashboardData) { resize: { enabled: true, stop: function (e, ui, element) { - var slice_data = $(element).data('slice'); - if (slice_data) { - dashboard.getSlice(slice_data.slice_id).resize(); - } + dashboard.getSlice($(element).attr('slice_id')).resize(); } }, serialize_params: function (_w, wgd) { diff --git a/dashed/templates/dashed/base.html b/dashed/templates/dashed/base.html index fa82fd0dd28..9ac1eef969a 100644 --- a/dashed/templates/dashed/base.html +++ b/dashed/templates/dashed/base.html @@ -1,9 +1,9 @@ {% extends "appbuilder/baselayout.html" %} {% block head_css %} - {{super()}} - + + {{super()}} {% endblock %} {% block head_js %} diff --git a/dashed/templates/dashed/dashboard.html b/dashed/templates/dashed/dashboard.html index 5f1c5bb0782..7eae55b0c84 100644 --- a/dashed/templates/dashed/dashboard.html +++ b/dashed/templates/dashed/dashboard.html @@ -4,7 +4,7 @@ {{ super() }} {% endblock %} - +{% block title %}[dashboard] {{ dashboard.dashboard_title }}{% endblock %} {% block body %}
diff --git a/dashed/templates/dashed/explore.html b/dashed/templates/dashed/explore.html index 50400ac9aa9..61436fd4c75 100644 --- a/dashed/templates/dashed/explore.html +++ b/dashed/templates/dashed/explore.html @@ -1,5 +1,13 @@ {% extends "dashed/basic.html" %} +{% block title %} + {% if slice %} + [slice] {{ slice.slice_name }} + {% else %} + [explore] {{ viz.datasource.table_name }} + {% endif %} +{% endblock %} + {% block body %} {% set datasource = viz.datasource %} {% set form = viz.form %} @@ -45,7 +53,6 @@ {% endif %}
- cached