Move the shiny:conditional event to the top of $updateConditionals()

This commit is contained in:
Yihui Xie
2015-09-02 12:29:37 -05:00
parent 1ee2a25eca
commit 4e5c5f9c5b

View File

@@ -283,6 +283,10 @@ var ShinyApp = function() {
};
this.$updateConditionals = function() {
$(document).trigger({
type: 'shiny:conditional'
});
var inputs = {};
// Input keys use "name:type" format; we don't want the user to
@@ -310,10 +314,6 @@ var ShinyApp = function() {
var show = condFunc(scope);
var showing = el.css("display") !== "none";
if (show !== showing) {
el.trigger({
type: 'shiny:conditional',
show: show
});
if (show) {
el.trigger('show');
el.show();