From 892839e12d70cc79758af1a135090bcb543784da Mon Sep 17 00:00:00 2001 From: Fabien Lelaquais <86590727+FabienLelaquais@users.noreply.github.com> Date: Tue, 15 Oct 2024 17:00:49 +0200 Subject: [PATCH] Correct links for 'Release Notes' and 'Contributing' in nav bar - Minor fixes --- .../viselements/generic/date_range.md_template | 2 +- .../gui/viselements/generic/dialog.md_template | 17 +++++++++-------- taipy_theme/partials/header.html | 4 ++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/docs/refmans/gui/viselements/generic/date_range.md_template b/docs/refmans/gui/viselements/generic/date_range.md_template index f7471f0cd..256da822d 100644 --- a/docs/refmans/gui/viselements/generic/date_range.md_template +++ b/docs/refmans/gui/viselements/generic/date_range.md_template @@ -55,7 +55,7 @@ An `on_change` callback can be set to retrieve the user's selection: def on_change(s: State, name: str, value: any): if name == "dates": # value[0] is set to the first selected date - # value[1] is set to the first selected date + # value[1] is set to the second selected date ``` ## Selecting a range with times {data-source="gui:doc/examples/controls/date_range_with_time.py"} diff --git a/docs/refmans/gui/viselements/generic/dialog.md_template b/docs/refmans/gui/viselements/generic/dialog.md_template index 96fe3cb37..4e36ee2de 100644 --- a/docs/refmans/gui/viselements/generic/dialog.md_template +++ b/docs/refmans/gui/viselements/generic/dialog.md_template @@ -155,16 +155,17 @@ This definition indicates that: Here’s how you can implement the *dialog_action()* function to handle the button presses: ```python def dialog_action(state, _, payload): - if payload["args"][0] == 0: - ... # The first button was pressed - elif payload["args"][0] == 1: # Second button - ... # The second button was pressed - else: # Close button (index == -1) - ... # The dialog's Close button was pressed + if payload["args"][0] == 0: # The first button was pressed + ... + elif payload["args"][0] == 1: # The second button was pressed + ... + else: # The dialog's Close button was pressed (index == -1) + ... state.show_dialog = False ``` The *payload["args"]\[0\]* value indicates which button was pressed: + - 0: The first button ("Couldn't be better") was pressed. - 1: The second button ("Not my day") was pressed. - -1: The Close button of the dialog was pressed. @@ -178,8 +179,8 @@ When *show_dialog* is set to True, the dialog will display two buttons at the bo
Automatic buttons
-If the user presses the first button, "COULDN'T BE BETTER", the *dialog_action()* callback will be -invoked with *payload["args"]\[0\]* set to 0. +If the user presses the first button, "COULDN'T BE BETTER", the *dialog_action()* callback function +is invoked with *payload["args"]\[0\]* set to 0. ## Dialog with page diff --git a/taipy_theme/partials/header.html b/taipy_theme/partials/header.html index a7799999f..808101bbc 100644 --- a/taipy_theme/partials/header.html +++ b/taipy_theme/partials/header.html @@ -91,12 +91,12 @@