Skip to content

Commit c0a7a6d

Browse files
committed
don't hide the current element, instead make sure new element is hidden before fading in
1 parent 29c4847 commit c0a7a6d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

inst/www/shared/shiny-showcase.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@
150150
}
151151
}
152152

153+
// hide the new element before doing anything to it
154+
$(newHostElement).hide();
153155
$(currentHostElement).fadeOut(animateCodeMs, function() {
154156
var tabs = document.getElementById("showcase-code-tabs");
155157
currentHostElement.removeChild(tabs);
@@ -162,7 +164,7 @@
162164
document.getElementById("showcase-code-content").removeAttribute("style");
163165
}
164166

165-
$(newHostElement).fadeIn();
167+
$(newHostElement).fadeIn(animateCodeMs);
166168
if (!above) {
167169
// remove the applied width and zoom on the app container, and
168170
// scroll smoothly down to the code's new home
@@ -191,7 +193,6 @@
191193
if (above) {
192194
$(document.body).animate({ scrollTop: 0 }, animateCodeMs);
193195
}
194-
$(currentHostElement).hide();
195196
isCodeAbove = above;
196197
setAppCodeSxsWidths(above && animate);
197198
$(window).trigger("resize");

0 commit comments

Comments
 (0)