MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 463: Line 463:
             filtersDiv.css('display', 'grid').hide().slideDown(100);
             filtersDiv.css('display', 'grid').hide().slideDown(100);
             $(this).text('[FILTER]');
             $(this).text('[FILTER]');
            resetButton.css('display', 'inline-block'); // Show the reset button
             // Attach click handler to document
             // Attach click handler to document
             $(document).on('mousedown.hideFilters', function(event) {
             $(document).on('mousedown.hideFilters', function(event) {
Line 474: Line 473:
                     });
                     });
                     $('.general-toggle').text('[FILTER]');
                     $('.general-toggle').text('[FILTER]');
                    resetButton.css('display', 'none'); // Hide the reset button when filters are not visible
                     // Remove the document click handler
                     // Remove the document click handler
                     $(document).off('mousedown.hideFilters');
                     $(document).off('mousedown.hideFilters');
Line 484: Line 482:
             });
             });
             $(this).text('[FILTER]');
             $(this).text('[FILTER]');
            resetButton.css('display', 'none'); // Hide the reset button when filters are not visible
             // Remove the document click handler
             // Remove the document click handler
             $(document).off('mousedown.hideFilters');
             $(document).off('mousedown.hideFilters');
Line 645: Line 642:
     $(window).on('scroll', function() {
     $(window).on('scroll', function() {
         var filtersDiv = $('#filters');
         var filtersDiv = $('#filters');
        var resetButton = $('.reset-button');


         if (filtersDiv.hasClass('is-visible')) {
         if (filtersDiv.hasClass('is-visible')) {
Line 653: Line 649:
             });
             });
             $('.general-toggle').text('[FILTER]'); // Update the toggle button text
             $('.general-toggle').text('[FILTER]'); // Update the toggle button text
            resetButton.css('display', 'none'); // Hide the reset button when filters are not visible
         }
         }
     });
     });

Navigation menu