integrations: Hide page content until all data has loaded.

Set the initial visibility of the page content to hidden via
the stylesheet, and allow any data fetching and rendering to
complete before making content visible.

Adjust the conditional logic within `render` to first check for
the case in which a user goes to a doc link, the case in which
we asynchronously fetch data prior making content visible.

Fixes #9577.
This commit is contained in:
Jack Zhang
2018-06-12 15:55:44 -07:00
committed by Tim Abbott
parent d0bc8d0736
commit ac76935f25
2 changed files with 19 additions and 12 deletions

View File

@@ -195,6 +195,7 @@ function hide_catalog_show_integration() {
$(".extra, #integration-main-text, #integration-search").css("display", "none");
show_integration(doc);
$(".main").css("visibility", "visible");
}
$.get({
@@ -249,22 +250,26 @@ function render(next_state) {
var previous_state = Object.assign({}, state);
state = next_state;
if (previous_state.integration !== next_state.integration) {
if (next_state.integration !== null) {
hide_catalog_show_integration();
} else {
if (previous_state.integration !== next_state.integration &&
next_state.integration !== null) {
hide_catalog_show_integration();
} else {
if (previous_state.integration !== next_state.integration) {
hide_integration_show_catalog();
}
if (previous_state.category !== next_state.category) {
update_categories();
update_integrations();
}
if (previous_state.query !== next_state.query) {
update_integrations();
}
$(".main").css("visibility", "visible");
}
if (previous_state.category !== next_state.category) {
update_categories();
update_integrations();
}
if (previous_state.query !== next_state.query) {
update_integrations();
}
}
function dispatch(action, payload) {

View File

@@ -2428,6 +2428,8 @@ nav ul li.active::after {
background-color: #fff;
box-shadow: 0px 0px 80px hsla(0, 0%, 0%, 0.12);
visibility: hidden;
}
.portico-landing.integrations .padded-content {