mrfakename commited on
Commit
42523af
·
verified ·
1 Parent(s): 1a6367d

Update app/ui.py

Browse files
Files changed (1) hide show
  1. app/ui.py +30 -30
app/ui.py CHANGED
@@ -110,37 +110,37 @@ with gr.Blocks(css=CSS + """
110
  </div>
111
  """)
112
 
113
- # Add modal control JavaScript
114
- app.load(None, None, js="""
115
- function() {
116
- function toggleModal(show) {
117
- document.querySelector('.shortcuts-modal').classList.toggle('show', show);
118
- document.querySelector('.modal-backdrop').classList.toggle('show', show);
119
- }
120
 
121
- document.addEventListener('keydown', function(e) {
122
- // Only handle shortcuts when not typing in an input
123
- if (document.activeElement.tagName === 'INPUT' ||
124
- document.activeElement.tagName === 'TEXTAREA') {
125
- return;
126
- }
127
 
128
- // Check for shift + / or ? key
129
- if ((e.key === '/' && e.shiftKey) || e.key === '?') {
130
- toggleModal(true);
131
- }
132
- // Check for escape key
133
- else if (e.key === 'Escape') {
134
- toggleModal(false);
135
- }
136
- });
137
 
138
- // Close modal when clicking backdrop
139
- document.querySelector('.modal-backdrop').addEventListener('click', function() {
140
- toggleModal(false);
141
- });
142
 
143
- // Make toggleModal available globally
144
- window.toggleModal = toggleModal;
145
- }
146
- """)
 
110
  </div>
111
  """)
112
 
113
+ # # Add modal control JavaScript
114
+ # app.load(None, None, js="""
115
+ # function() {
116
+ # function toggleModal(show) {
117
+ # document.querySelector('.shortcuts-modal').classList.toggle('show', show);
118
+ # document.querySelector('.modal-backdrop').classList.toggle('show', show);
119
+ # }
120
 
121
+ # document.addEventListener('keydown', function(e) {
122
+ # // Only handle shortcuts when not typing in an input
123
+ # if (document.activeElement.tagName === 'INPUT' ||
124
+ # document.activeElement.tagName === 'TEXTAREA') {
125
+ # return;
126
+ # }
127
 
128
+ # // Check for shift + / or ? key
129
+ # if ((e.key === '/' && e.shiftKey) || e.key === '?') {
130
+ # toggleModal(true);
131
+ # }
132
+ # // Check for escape key
133
+ # else if (e.key === 'Escape') {
134
+ # toggleModal(false);
135
+ # }
136
+ # });
137
 
138
+ # // Close modal when clicking backdrop
139
+ # document.querySelector('.modal-backdrop').addEventListener('click', function() {
140
+ # toggleModal(false);
141
+ # });
142
 
143
+ # // Make toggleModal available globally
144
+ # window.toggleModal = toggleModal;
145
+ # }
146
+ # """)