EasySci commited on
Commit
d6a4825
·
1 Parent(s): d26ad1c

Update app2.py

Browse files
Files changed (1) hide show
  1. app2.py +5 -7
app2.py CHANGED
@@ -74,11 +74,11 @@ current_state = 'main_panel' # Variable to keep track of the current state
74
  # Function to reset the main panel content to the initial content and store the previous content
75
  def reset_main_panel(event):
76
  global previous_content, current_state
77
- current_state = 'main_panel'
78
  # Store the previous content of the current state if it's not already stored
79
- if current_state not in previous_content:
80
  previous_content[current_state] = main_body_instance.main_body.copy()
81
 
 
82
  # Reset the main panel to the initial state
83
  main_body_instance.main_body.clear() # Clear the existing main panel content
84
  main_body_instance.main_body.append(pn.pane.LaTeX("Please select some tags!", styles={'font-size': '20pt'}))
@@ -88,13 +88,11 @@ def reset_main_panel(event):
88
  def update_main_panel_button3(event):
89
  global previous_content, current_state
90
  # Store the previous content of the current state if it's not already stored
91
- if current_state not in previous_content:
92
  previous_content[current_state] = main_body_instance.main_body.copy()
93
 
94
- # Update the current state to main_panel_button3
95
- current_state = 'main_panel_button3'
96
-
97
- # Reset the main panel to the desired content when button3 is pressed
98
  main_body_instance.main_body.clear() # Clear the existing main panel content
99
  main_body_instance.main_body.append(pn.pane.Markdown("You pressed button3!"))
100
  main_body_instance.param.trigger('main_body') # Trigger the update manually
 
74
  # Function to reset the main panel content to the initial content and store the previous content
75
  def reset_main_panel(event):
76
  global previous_content, current_state
 
77
  # Store the previous content of the current state if it's not already stored
78
+ if current_state in previous_content:
79
  previous_content[current_state] = main_body_instance.main_body.copy()
80
 
81
+ current_state = 'main_panel' # Update the current state
82
  # Reset the main panel to the initial state
83
  main_body_instance.main_body.clear() # Clear the existing main panel content
84
  main_body_instance.main_body.append(pn.pane.LaTeX("Please select some tags!", styles={'font-size': '20pt'}))
 
88
  def update_main_panel_button3(event):
89
  global previous_content, current_state
90
  # Store the previous content of the current state if it's not already stored
91
+ if current_state in previous_content:
92
  previous_content[current_state] = main_body_instance.main_body.copy()
93
 
94
+ current_state = 'main_panel_button3' # Update the current state
95
+ # Update 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