Use sendImageSize instead of Shiny.bindAll to resend CSS info

This commit is contained in:
Carson
2021-05-04 14:19:40 -05:00
parent 2ffa8707ea
commit d430b80191
5 changed files with 16 additions and 14 deletions

View File

@@ -4766,7 +4766,7 @@
import_jquery6.default(sheet.ownerNode).remove();
};
var scheduleCssReporter = function scheduleCssReporter2() {
var handle = setInterval(Shiny.bindAll, 100);
var handle = setInterval(sendImageSize, 100);
setTimeout(function() {
return clearInterval(handle);
}, 1e4);
@@ -6444,6 +6444,7 @@
}
});
inputBindings.register(fileInputBinding, "shiny.fileInputBinding");
var sendImageSize;
function initShiny() {
var shinyapp = Shiny.shinyapp = new ShinyApp();
function bindOutputs() {
@@ -6768,9 +6769,9 @@
});
}
var sendImageSizeDebouncer = new Debouncer(null, doSendImageSize, 0);
function sendImageSize() {
sendImageSize = function sendImageSize() {
sendImageSizeDebouncer.normalCall();
}
};
inputBatchSender.lastChanceCallback.push(function() {
if (sendImageSizeDebouncer.isPending())
sendImageSizeDebouncer.immediateCall();

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

@@ -4081,12 +4081,11 @@ function main(): void {
};
// There doesn't appear to be proper way to wait until new styles have been
// _applied everywhere_ so we repeatedly call bindAll() every .1s for 10 seconds.
// (bindAll() is used as an indirect way of calling doSendTheme() which resends CSS
// info stored in input values accessible to shiny::getCurrentOutputInfo()).
// _applied everywhere_ so we repeatedly call sendImageSize() (which also
// sends colors and fonts) every .1s for 10 seconds.
/* global Shiny */
let scheduleCssReporter = function () {
let handle = setInterval(Shiny.bindAll, 100);
let handle = setInterval(sendImageSize, 100);
setTimeout(() => clearInterval(handle), 10000);
};
@@ -6393,6 +6392,8 @@ function main(): void {
});
inputBindings.register(fileInputBinding, "shiny.fileInputBinding");
let sendImageSize;
// "init_shiny.js"
function initShiny() {
const shinyapp = (Shiny.shinyapp = new ShinyApp());
@@ -6875,9 +6876,9 @@ function main(): void {
}
const sendImageSizeDebouncer = new Debouncer(null, doSendImageSize, 0);
function sendImageSize() {
sendImageSize = function () {
sendImageSizeDebouncer.normalCall();
}
};
// Make sure sendImageSize actually gets called before the inputBatchSender
// sends data to the server.
inputBatchSender.lastChanceCallback.push(function () {