Skip to content

Commit

Permalink
use setDarkMode and update example
Browse files Browse the repository at this point in the history
  • Loading branch information
hypebright committed Apr 28, 2024
1 parent af9f0f9 commit 519466e
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 50 deletions.
3 changes: 2 additions & 1 deletion inst/examples/update_app/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ app <- shinyApp(
server = function(input, output, session) {
observeEvent(input$goButton, {
f7Dialog(
id = "test2",
title = "Dialog title",
text = "This is an alert dialog"
text = "This is an alert dialog",
type = "confirm"
)
})
Expand Down
4 changes: 2 additions & 2 deletions inst/shinyMobile-2.0.0/dist/shinyMobile.min.css.map

Large diffs are not rendered by default.

58 changes: 29 additions & 29 deletions inst/shinyMobile-2.0.0/dist/shinyMobile.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions inst/shinyMobile-2.0.0/dist/shinyMobile.min.js.map

Large diffs are not rendered by default.

17 changes: 1 addition & 16 deletions srcjs/handlers/updateApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,7 @@ $(function() {
}

if (message.hasOwnProperty("dark")) {
if (message.dark) {
$("html").addClass("dark");
$("html").removeClass("light");
$("body").addClass("dark");
$("body").removeClass("light");
} else {
$("html").addClass("light");
$("html").removeClass("dark");
$("body").addClass("light");
$("body").removeClass("dark");
}
app.setDarkMode(message.dark);
}

if (message.hasOwnProperty("theme")) {
Expand All @@ -36,11 +26,6 @@ $(function() {
}
}

// Remove color, dark and theme params from message
delete message.color;
delete message.dark;
delete message.theme;

// Merge new config to existing one
app.utils.extend(app.params, message);
});
Expand Down

0 comments on commit 519466e

Please sign in to comment.