Fix loading text if naturalEvents is not set - #628
Conversation
| <div id="products"></div> | ||
| <div id="wv-events">Loading...</div> | ||
| <div id="wv-events"></div> | ||
| <div id="wv-loading">Loading...</div> |
There was a problem hiding this comment.
Perhaps this div should go below #wv-data, since "Loading..." is actually indicating that any part of the sidebar is in a loading state and, it contains less important information than what is in the data tab. Otherwise, this looks good to me.
There was a problem hiding this comment.
Yes I agree, I'll push that in a minute
|
I originally added the "Loading..." text to fix an issue; when switching to the events tab, there is a delay while events information loads and the tab was empty with no indication that anything was loading. On some connections, it would take several seconds for anything to display in the tab, which made it seem like there were no events and would lead to users switching tabs again before anything loaded. You can reproduce that issue by setting your dev tools to emulate a slow connection, disabling cache, reloading the page and then clicking on the events tab. On |
|
Oh ok I see, so should I just add an else condition after worldview/web/js/layers/wv.layers.sidebar.js Lines 199 to 210 in a85692d Something like: |
|
@PacoDu I think that condition could go here for a quick fix: https://github.com/nasa-gibs/worldview/blob/master/web/js/wv.main.js#L147-L149 But it would probably be better to take the |
|
@Benjaki2 Yes the code would be more consistent. I don't have time now but I'll take a look tomorrow. |
|
Well, sorry for the delay :). |
localjo
left a comment
There was a problem hiding this comment.
Looks good. We may have a little trouble merging due to other changes that might conflict.
|
|
||
| var init = function () { | ||
| // Display loading information for user feedback on slow network | ||
| $('#wv-events').text('Loading...'); |
There was a problem hiding this comment.
This file has changed in the module-loaders branch. Let's try to change the target of this pull request to that branch, and manually adjust it if necessary.
Fixes #627 .
Changes in this pull request:
@nasa-gibs/worldview