Skip to content

Commit 49edf7e

Browse files
committed
add update_title config option
- add `update_title` String field to DashConfig struct - use `"Updating..." as default - inject its value into the frontend, to make it available to the dash renderer
1 parent cb64b94 commit 49edf7e

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

src/app/config.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ struct DashConfig
1616
include_assets_files ::Bool
1717
show_undo_redo ::Bool
1818
compress ::Bool
19+
update_title ::String
1920
end

src/app/dashapp.jl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ get_assets_path(app::DashApp) = joinpath(app.root_path, get_setting(app, :assets
185185
assets_external_path,
186186
include_assets_files,
187187
show_undo_redo,
188-
compress
188+
compress,
189+
update_title
189190
)
190191
191192
Dash is a framework for building analytical web applications. No JavaScript required.
@@ -280,6 +281,12 @@ If a parameter can be set by an environment variable, that is listed as:
280281
- `compress::Bool`: Default ``true``, controls whether gzip is used to compress
281282
files and data served by HTTP.jl when supported by the client. Set to
282283
``false`` to disable compression completely.
284+
285+
- `update_title::String`: Default ``Updating...``. Configures the document.title
286+
(the text that appears in a browser tab) text when a callback is being run.
287+
Set to '' if you don't want the document.title to change or if you
288+
want to control the document.title through a separate component or
289+
clientside callback.
283290
"""
284291
function dash(;
285292
external_stylesheets = ExternalSrcType[],
@@ -299,7 +306,8 @@ function dash(;
299306
assets_external_path = dash_env("assets_external_path"),
300307
include_assets_files = dash_env(Bool, "include_assets_files", true),
301308
show_undo_redo = false,
302-
compress = true
309+
compress = true,
310+
update_title = "Updating..."
303311

304312
)
305313

@@ -323,7 +331,8 @@ function dash(;
323331
assets_external_path,
324332
include_assets_files,
325333
show_undo_redo,
326-
compress
334+
compress,
335+
update_title
327336
)
328337
result = DashApp(app_root_path(), isinteractive(), config, index_string)
329338
return result

src/handler/index_page.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ function config_html(app::DashApp)
8484
:ui => get_devsetting(app, :ui),
8585
:props_check => get_devsetting(app, :props_check),
8686
:show_undo_redo => get_setting(app, :show_undo_redo),
87-
:suppress_callback_exceptions => get_setting(app, :suppress_callback_exceptions)
87+
:suppress_callback_exceptions => get_setting(app, :suppress_callback_exceptions),
88+
:update_title => get_setting(app, :update_title)
8889
)
8990
if get_devsetting(app, :hot_reload)
9091
config[:hot_reload] = (

0 commit comments

Comments
 (0)