relay offsetWidth/offsetHeight of htmlwidgets to clientData (#1981)

Addresses #1980
This commit is contained in:
Carson Sievert
2018-03-20 18:37:43 -05:00
committed by Joe Cheng
parent 2e0d9b5475
commit 0555cbdd28
6 changed files with 11 additions and 9 deletions

View File

@@ -277,7 +277,7 @@ function initShiny() {
// The server needs to know the size of each image and plot output element,
// in case it is auto-sizing
$('.shiny-image-output, .shiny-plot-output').each(function() {
$('.shiny-image-output, .shiny-plot-output, .shiny-report-size').each(function() {
var id = getIdFromEl(this);
if (this.offsetWidth !== 0 || this.offsetHeight !== 0) {
initialValues['.clientdata_output_' + id + '_width'] = this.offsetWidth;
@@ -285,7 +285,7 @@ function initShiny() {
}
});
function doSendImageSize() {
$('.shiny-image-output, .shiny-plot-output').each(function() {
$('.shiny-image-output, .shiny-plot-output, .shiny-report-size').each(function() {
var id = getIdFromEl(this);
if (this.offsetWidth !== 0 || this.offsetHeight !== 0) {
inputs.setInput('.clientdata_output_' + id + '_width', this.offsetWidth);