Skip to content

Commit

Permalink
Changes to default index, consolidating _dash-config
Browse files Browse the repository at this point in the history
In this commit, we take the `_dash-config` script, with the `to_JSON(self$config)` variable, and merge them all into one variable named `config`.
  • Loading branch information
HammadTheOne committed Jan 17, 2020
1 parent ab54aa0 commit ce4a8b6
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions R/dash.R
Original file line number Diff line number Diff line change
Expand Up @@ -1472,17 +1472,14 @@ Dash <- R6::R6Class(
meta_tags <- all_tags[["meta_tags"]]

# define the react-entry-point
app_entry <- "<div id='react-entry-point'>
<div class='_dash-loading'>Loading...</div>
</div>"

app_entry <- "<div id='react-entry-point'><div class='_dash-loading'>Loading...</div></div>"
# define the dash default config key
config <- "<script id='_dash-config' type='application/json'> {to_JSON(self$config)} </script>"
config <- sprintf("<script id='_dash-config' type='application/json'> %s </script>", to_JSON(self$config))

if (!is.null(private$custom_index)) {
interpolated_index <- glue::glue(private$custom_index)
string_index <- glue::glue(private$custom_index)

private$.index <- interpolated_index
private$.index <- string_index
}
else {
private$.index <- sprintf(
Expand All @@ -1496,12 +1493,9 @@ Dash <- R6::R6Class(
</head>
<body>
<div id=%s>
<div class="_dash-loading">Loading...</div>
</div>
%s
<footer>
<script id=%s type="application/json"> %s </script>
%s
%s
</footer>
</body>
Expand All @@ -1512,7 +1506,6 @@ Dash <- R6::R6Class(
css_tags,
app_entry,
config,
to_JSON(self$config),
scripts
)
}
Expand Down

0 comments on commit ce4a8b6

Please sign in to comment.