trohith89 commited on
Commit
6e2569e
·
verified ·
1 Parent(s): 9f90df1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -144,7 +144,7 @@ for i, t in enumerate(teams[:5]):
144
  with row1[i]:
145
  # Display the styled button using st.markdown
146
  button_html = f"""
147
- <a href='#' class='team-card' id='team_{t}_row1'>{t}</a>
148
  """
149
  st.markdown(button_html, unsafe_allow_html=True)
150
  # Hidden Streamlit button to handle the click
@@ -157,7 +157,7 @@ for i, t in enumerate(teams[5:10]):
157
  with row2[i]:
158
  # Display the styled button using st.markdown
159
  button_html = f"""
160
- <a href='#' class='team-card' id='team_{t}_row2'>{t}</a>
161
  """
162
  st.markdown(button_html, unsafe_allow_html=True)
163
  # Hidden Streamlit button to handle the click
@@ -248,8 +248,7 @@ st.markdown("""
248
  button.addEventListener('click', function(e) {
249
  e.preventDefault();
250
  const team = this.textContent;
251
- const hiddenButton = document.querySelector(`button[data-testid="hidden_team_${team}_row1"]`) ||
252
- document.querySelector(`button[data-testid="hidden_team_${team}_row2"]`);
253
  if (hiddenButton) {
254
  hiddenButton.click();
255
  }
 
144
  with row1[i]:
145
  # Display the styled button using st.markdown
146
  button_html = f"""
147
+ <div class='team-card' id='team_{t}_row1'>{t}</div>
148
  """
149
  st.markdown(button_html, unsafe_allow_html=True)
150
  # Hidden Streamlit button to handle the click
 
157
  with row2[i]:
158
  # Display the styled button using st.markdown
159
  button_html = f"""
160
+ <div class='team-card' id='team_{t}_row2'>{t}</div>
161
  """
162
  st.markdown(button_html, unsafe_allow_html=True)
163
  # Hidden Streamlit button to handle the click
 
248
  button.addEventListener('click', function(e) {
249
  e.preventDefault();
250
  const team = this.textContent;
251
+ const hiddenButton = document.querySelector(`button[data-testid="stButton-${team.toLowerCase().replace(' ', '-')}"]`);
 
252
  if (hiddenButton) {
253
  hiddenButton.click();
254
  }