Skip to content

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

Open
cpsievert wants to merge 1 commit into
mainfrom
add-restyle-js-event
Open

cpsievert wants to merge 1 commit into
mainfrom
add-restyle-js-event

Conversation

@cpsievert

Copy link
Copy Markdown
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
if (browser.isIE) sheet.cssText = "";
$(sheet.ownerNode).remove();
$(document).trigger({
type: 'shiny:restyle', oldSheet: sheet

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

wch commented Feb 22, 2021

Copy link
Copy Markdown
Collaborator

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

@cpsievert

Copy link
Copy Markdown
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