Spaces:
Running
Running
Update app2.py
Browse files
app2.py
CHANGED
|
@@ -77,11 +77,11 @@ def reset_main_panel(event):
|
|
| 77 |
# Store the previous content of the current state if it's not already stored
|
| 78 |
previous_content[current_state] = main_body_instance.main_body.copy()
|
| 79 |
|
|
|
|
| 80 |
current_state = 'main_panel'
|
|
|
|
| 81 |
# Reset the main panel to the initial state
|
| 82 |
main_body_instance.main_body.clear() # Clear the existing main panel content
|
| 83 |
-
# main_body_instance.main_body.append(pn.pane.LaTeX("Please select some tags!", styles={'font-size': '20pt'}))
|
| 84 |
-
# main_body_instance.param.trigger('main_body') # Trigger the update manually
|
| 85 |
|
| 86 |
# Function to update the main panel content when button3 is pressed
|
| 87 |
def update_main_panel_button3(event):
|
|
@@ -94,8 +94,6 @@ def update_main_panel_button3(event):
|
|
| 94 |
|
| 95 |
# Reset the main panel to the desired content when button3 is pressed
|
| 96 |
main_body_instance.main_body.clear() # Clear the existing main panel content
|
| 97 |
-
# main_body_instance.main_body.append(pn.pane.Markdown("You pressed button3!"))
|
| 98 |
-
# main_body_instance.param.trigger('main_body') # Trigger the update manually
|
| 99 |
|
| 100 |
# Attach the functions to the on_click event of button1 and button3
|
| 101 |
button1.on_click(reset_main_panel)
|
|
@@ -111,7 +109,7 @@ def show_previous_content(event):
|
|
| 111 |
main_body_instance.main_body.extend(previous_content[current_state]) # Add the previous content
|
| 112 |
else:
|
| 113 |
main_body_instance.main_body.clear() # Clear the existing main panel content
|
| 114 |
-
main_body_instance.main_body.append(pn.pane.Markdown("No previous content available!"))
|
| 115 |
main_body_instance.param.trigger('main_body') # Trigger the update manually
|
| 116 |
|
| 117 |
# Attach the show_previous_content function to the on_click event of button1 and button3
|
|
|
|
| 77 |
# Store the previous content of the current state if it's not already stored
|
| 78 |
previous_content[current_state] = main_body_instance.main_body.copy()
|
| 79 |
|
| 80 |
+
# Update the current state to mail_panel
|
| 81 |
current_state = 'main_panel'
|
| 82 |
+
|
| 83 |
# Reset the main panel to the initial state
|
| 84 |
main_body_instance.main_body.clear() # Clear the existing main panel content
|
|
|
|
|
|
|
| 85 |
|
| 86 |
# Function to update the main panel content when button3 is pressed
|
| 87 |
def update_main_panel_button3(event):
|
|
|
|
| 94 |
|
| 95 |
# Reset the main panel to the desired content when button3 is pressed
|
| 96 |
main_body_instance.main_body.clear() # Clear the existing main panel content
|
|
|
|
|
|
|
| 97 |
|
| 98 |
# Attach the functions to the on_click event of button1 and button3
|
| 99 |
button1.on_click(reset_main_panel)
|
|
|
|
| 109 |
main_body_instance.main_body.extend(previous_content[current_state]) # Add the previous content
|
| 110 |
else:
|
| 111 |
main_body_instance.main_body.clear() # Clear the existing main panel content
|
| 112 |
+
main_body_instance.main_body.append(pn.pane.Markdown("### No previous content available!"))
|
| 113 |
main_body_instance.param.trigger('main_body') # Trigger the update manually
|
| 114 |
|
| 115 |
# Attach the show_previous_content function to the on_click event of button1 and button3
|