Skip to content

Commit

Permalink
Merge pull request #2582 from rstudio/barret_showcase_hidden_wide
Browse files Browse the repository at this point in the history
Fix showcase bug where hidden by default on wide window
  • Loading branch information
cpsievert authored Sep 11, 2019
2 parents 2e0221e + ba5733e commit b889b0d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ shiny 1.3.2.9001

* Fixed [rstudio/reactlog#36](https://github.com/rstudio/reactlog/issues/36): Changes to reactive values not displaying accurately in reactlog. ([#2424](https://github.com/rstudio/shiny/pull/2424))

* Fixed [#2598](https://github.com/rstudio/shiny/issues/2598): Showcase files don't appear with a wide window. ([#2582](https://github.com/rstudio/shiny/pull/2582))

* Fixed [#2329](https://github.com/rstudio/shiny/issues/2329), [#1817](https://github.com/rstudio/shiny/issues/1817): These bugs were reported as fixed in Shiny 1.3.0 but were not actually fixed because some JavaScript changes were accidentally not included in the release. The fix resolves issues that occur when `withProgressBar()` or bookmarking are combined with the [networkD3](https://christophergandrud.github.io/networkD3/) package's Sankey plot.

### Library updates
Expand Down
7 changes: 5 additions & 2 deletions inst/www/shared/shiny-showcase.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
el.id = "srcref_" + srcref;
var ref = srcref;
var code = document.getElementById(srcfile.replace(/\./g, "_") + "_code");
// if there is no code file (might be a shiny file), quit early
if (!code) return;
var start = findTextPoint(code, ref[0], ref[4]);
var end = findTextPoint(code, ref[2], ref[5]);

Expand Down Expand Up @@ -148,6 +150,8 @@
}
}

// hide the new element before doing anything to it
$(newHostElement).hide();
$(currentHostElement).fadeOut(animateCodeMs, function() {
var tabs = document.getElementById("showcase-code-tabs");
currentHostElement.removeChild(tabs);
Expand All @@ -160,7 +164,7 @@
document.getElementById("showcase-code-content").removeAttribute("style");
}

$(newHostElement).fadeIn();
$(newHostElement).fadeIn(animateCodeMs);
if (!above) {
// remove the applied width and zoom on the app container, and
// scroll smoothly down to the code's new home
Expand Down Expand Up @@ -189,7 +193,6 @@
if (above) {
$(document.body).animate({ scrollTop: 0 }, animateCodeMs);
}
$(newHostElement).hide();
isCodeAbove = above;
setAppCodeSxsWidths(above && animate);
$(window).trigger("resize");
Expand Down

0 comments on commit b889b0d

Please sign in to comment.