Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shiny:restyle event for listening to instances where session() updates stylesheet(s) #3301

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cpsievert
Copy link
Collaborator

Will be useful for real-time theming integration in flexdashboard rstudio/flexdashboard#308

…dates stylesheet(s).

Will be useful for real-time theming integration in flexdashboard rstudio/flexdashboard#308
@@ -174,6 +174,9 @@ function renderDependency(dep) {
sheet.disabled = true;
if (browser.isIE) sheet.cssText = "";
$(sheet.ownerNode).remove();
$(document).trigger({
type: 'shiny:restyle', oldSheet: sheet
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is oldSheet used for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mainly so can get at the href so you which <link> was updated

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That being said, maybe we could add the name and version of the relevant HTML dependency

@wch
Copy link
Collaborator

wch commented Feb 22, 2021

Just a note: we should also document this in the Shiny JS events article.

@cpsievert
Copy link
Collaborator Author

Sorry, I was actually thinking of closing this on Friday since I found a way to do what I needed without this.

That being said, I suppose this could maybe useful for something else at some point 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants