Add report loading indicator, hide previous results when selected organization changes.

parent 19111985
......@@ -526,7 +526,8 @@ $(document).ready(function () {
name: "",
urls: Array,
mailto: document.head.querySelector("[name=mailto]").getAttribute('content'),
selected: null
selected: null,
loading: false
},
filters: {
// you cannot run filters in rawHtml, so this doesn't work.
......@@ -632,8 +633,10 @@ $(document).ready(function () {
if (!weeks_ago) {
weeks_ago = 0;
}
vueReport.loading = true;
vueReport.name = null;
$.getJSON('/data/report/' + OrganizationID + '/' + weeks_ago, function (data) {
vueReport.loading = false;
vueReport.urls = data.calculation["organization"]["urls"];
vueReport.points = data.rating;
vueReport.when = data.when;
......
......@@ -299,9 +299,11 @@
{{ organization.name }}
</option>
</select>
<span v-if='loading'> (loading...)</span>
{% endverbatim %}
</div>
<div v-if="selected">
<br />
<div v-if="name">
Dit resultaat delen? {% verbatim %}<span v-html="create_twitter_link(name, twitter_handle, points)"></span>{% endverbatim %}<br />
<br />
{% trans "Data from" %}: {% verbatim %}{{ humanize(when) }}{% endverbatim %}<br />
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment