mirror of
https://github.com/rstudio/shiny.git
synced 2026-02-07 21:26:08 -05:00
relay offsetWidth/offsetHeight of htmlwidgets to clientData (#1981)
Addresses #1980
This commit is contained in:
committed by
Joe Cheng
parent
2e0d9b5475
commit
0555cbdd28
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user