Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed to show spinner on data load #1491

Merged
merged 2 commits into from Oct 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -50,7 +50,11 @@
</span>
<span class="count"><span>[[_count]]</span></span>
</button>
<iron-collapse opened="[[opened]]">
<!-- TODO(stephanwlee): investigate further. For some reason,
transitionend that the iron-collapse relies on sometimes does not
trigger when rendering a chart with a spinner. A toy example cannot
reproduce this bug. -->
<iron-collapse opened="[[opened]]" no-animation>
<div class="content">
<template is="dom-if" if="[[opened]]" restamp="[[restamp]]"
id="ifOpened">
Expand Down
Expand Up @@ -120,7 +120,8 @@ export const DataLoaderBehavior = {

if (!this.isAttached) return;
this._loadDataAsync = this.async(() => {
this.dataLoading = true;
// Read-only property have a special setter.
this._setDataLoading(true);

// Before updating, cancel any network-pending updates, to
// prevent race conditions where older data stomps newer data.
Expand All @@ -140,7 +141,8 @@ export const DataLoaderBehavior = {
});

return Promise.all(promises).then(this._canceller.cancellable(result => {
this.dataLoading = false;
// Read-only property have a special setter.
this._setDataLoading(false);
if (result.cancelled) return;
this.onLoadFinish();
}));
Expand Down