nagasurendra commited on
Commit
e048e07
·
verified ·
1 Parent(s): cb06849

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -35
app.py CHANGED
@@ -284,42 +284,7 @@ button {
284
  alert("Your final order has been submitted!");
285
  }
286
  </script>
287
- <script>
288
- // Function to scroll to the top of the page
289
- function scrollToTop() {
290
- window.scrollTo({ top: 0, behavior: 'smooth' });
291
- }
292
-
293
- // Add a click listener to the "View Cart" button
294
- document.addEventListener("DOMContentLoaded", function() {
295
- const viewCartButton = document.querySelector("button:contains('View Cart')");
296
- if (viewCartButton) {
297
- viewCartButton.addEventListener("click", function() {
298
- scrollToTop();
299
- });
300
- }
301
- });
302
- </script>
303
- <script>
304
- document.addEventListener("DOMContentLoaded", function () {
305
- // Attach a click event listener to the View Cart button
306
- const observer = new MutationObserver(() => {
307
- const viewCartButton = document.querySelector("button:contains('View Cart')");
308
- if (viewCartButton) {
309
- viewCartButton.addEventListener("click", function () {
310
- // Scroll to the top of the page
311
- setTimeout(() => {
312
- window.scrollTo({ top: 0, behavior: 'smooth' });
313
- }, 100); // Slight delay to ensure page updates before scrolling
314
- });
315
- observer.disconnect(); // Stop observing once the button is found
316
- }
317
- });
318
 
319
- // Observe the Gradio container for dynamically loaded elements
320
- observer.observe(document.body, { childList: true, subtree: true });
321
- });
322
- </script>
323
  <script>
324
  document.addEventListener("DOMContentLoaded", function () {
325
  // Attach a global listener to all button clicks
 
284
  alert("Your final order has been submitted!");
285
  }
286
  </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
 
 
 
 
 
288
  <script>
289
  document.addEventListener("DOMContentLoaded", function () {
290
  // Attach a global listener to all button clicks