Skip to content

Commit

Permalink
assign random id to panel when id is NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
DivadNojnarg committed Mar 21, 2024
1 parent 68d2313 commit 49701d3
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
7 changes: 7 additions & 0 deletions R/f7Panel.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ f7Panel <- function(..., id = NULL, title = NULL,
panelCl <- sprintf("panel panel-%s panel-%s", side, effect)
if (resizable) panelCl <- paste0(panelCl, " panel-resizable")

if (is.null(id)) {
id <- sprintf(
"panel_%s",
round(stats::runif(1, min = 0, max = 1e9))
)
}

options[["effect"]] <- effect

shiny::tags$div(
Expand Down
2 changes: 1 addition & 1 deletion inst/shinyMobile-1.0.1/dist/shinyMobile.min.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/shinyMobile-1.0.1/dist/shinyMobile.min.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

12 changes: 5 additions & 7 deletions srcjs/bindings/panelInputBinding.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ $.extend(f7PanelBinding, {
this.app = getAppInstance();
var id = $(el).attr('id');
var config = {};
if (id !== undefined) {
config = JSON.parse($(el)
.find("script[data-for='" + id + "']")
.html());
// add id
config.el = '#' + id;
}
config = JSON.parse($(el)
.find("script[data-for='" + id + "']")
.html());
// add id
config.el = '#' + id;

// this is to show shiny outputs in the sheet
config.on = {
Expand Down

0 comments on commit 49701d3

Please sign in to comment.