Add shiny:sessionInit event (#1568)

* added a shiny:sessionInit JS event that is triggered at the end of the session's initialize method

* new entry

* update NEWS

* correct version number in NEWS.md

* fix typo
This commit is contained in:
Barbara Borges Ribeiro
2017-04-05 16:50:42 +01:00
committed by Winston Chang
parent dae11765bc
commit cf21e987f2
6 changed files with 7 additions and 3 deletions

View File

@@ -7,6 +7,8 @@ shiny 1.0.1.9000
### New features
### Minor new features and improvements
* Added a `shiny:sessioninitialized` Javascript event, which is fired at the end of the initialize method of the Session object. This allows us to listen for this event when we want to get the value of things like `Shiny.user`. ([#1568](https://github.com/rstudio/shiny/pull/1568))
* Fixed [#1649](https://github.com/rstudio/shiny/issues/1649): allow the `choices` argument in `checkboxGroupInput()` to be `NULL` (or `c()`) to keep backward compatibility with Shiny < 1.0.1. This will result in the same thing as providing `choices = character(0)`. ([#1652](https://github.com/rstudio/shiny/pull/1652))
### Bug fixes

View File

@@ -1241,6 +1241,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
addMessageHandler('config', function (message) {
this.config = { workerId: message.workerId, sessionId: message.sessionId };
if (message.user) exports.user = message.user;
$(document).trigger('shiny:sessioninitialized');
});
addMessageHandler('busy', function (message) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -631,6 +631,7 @@ var ShinyApp = function() {
addMessageHandler('config', function(message) {
this.config = {workerId: message.workerId, sessionId: message.sessionId};
if (message.user) exports.user = message.user;
$(document).trigger('shiny:sessioninitialized');
});
addMessageHandler('busy', function(message) {