GSMEthesis commited on
Commit
79f6db6
·
verified ·
1 Parent(s): d472b0c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +31 -9
app.py CHANGED
@@ -738,6 +738,36 @@ h3 {
738
  """, unsafe_allow_html=True)
739
 
740
  # ========== توابع اصلی ==========
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
741
  def add_js_for_hidden_button():
742
  st.markdown("""
743
  <script>
@@ -749,15 +779,7 @@ def add_js_for_hidden_button():
749
  """, unsafe_allow_html=True)
750
 
751
  def enhanced_likert_scale(question_data):
752
- st.markdown("""
753
- <style>
754
- /* مخفی کردن دکمه‌های اصلی Streamlit */
755
- div[data-testid="stButton"] > button[kind="primary"] {
756
- display: none !important;
757
- }
758
- </style>
759
- """, unsafe_allow_html=True)
760
- """لیکرت اسکیل با خط و نقاط - کاملاً واکنش‌گرا"""
761
  question = question_data["question"]
762
  key = question_data["key"]
763
  scale = question_data["scale"]
 
738
  """, unsafe_allow_html=True)
739
 
740
  # ========== توابع اصلی ==========
741
+ def add_js_for_hidden_likert_buttons():
742
+ st.markdown("""
743
+ <script>
744
+ function hideLikertButtons() {
745
+ // مخفی کردن دکمه‌های لیکرت
746
+ var likertButtons = document.querySelectorAll('.likert-button');
747
+ likertButtons.forEach(function(button) {
748
+ button.style.display = 'none';
749
+ });
750
+ }
751
+ </script>
752
+ """, unsafe_allow_html=True)
753
+
754
+ st.markdown("""
755
+ <style>
756
+ /* مخفی کردن دکمه‌های لیکرت با استفاده از کلاس‌های خاص */
757
+ .likert-button {
758
+ display: none !important;
759
+ }
760
+ </style>
761
+ """, unsafe_allow_html=True)
762
+
763
+ # اجرا کردن تابع جاوا اسکریپت برای مخفی کردن دکمه‌ها
764
+ st.components.v1.html("""
765
+ <script>
766
+ // اجرا کردن تابع مخفی کردن دکمه‌ها
767
+ window.onload = hideLikertButtons;
768
+ </script>
769
+ """, height=0)
770
+
771
  def add_js_for_hidden_button():
772
  st.markdown("""
773
  <script>
 
779
  """, unsafe_allow_html=True)
780
 
781
  def enhanced_likert_scale(question_data):
782
+ add_js_for_hidden_likert_buttons()
 
 
 
 
 
 
 
 
783
  question = question_data["question"]
784
  key = question_data["key"]
785
  scale = question_data["scale"]