Making WordPress.org

Changeset 11540


Ignore:
Timestamp:
02/10/2022 03:52:34 AM (4 years ago)
Author:
dd32
Message:

Trac: Calculate the correct Core Ticket popover position via Javascript upon opening the popover.

Thix fixes the positioning for mobile views (<770px) and ensures that future header changes don't need the CSS updating.

Fixes #6038.

Location:
sites/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/trac.wordpress.org/templates/site.html

    r11539 r11540  
    55
    66<?python
    7         scripts_version = '160'
     7        scripts_version = '161'
    88        project_slug = req.environ['HTTP_HOST'].split(':')[0].split('.')[0]
    99        wporg_endpoint = 'https://make.wordpress.org/' + project_slug + '/'
  • sites/trunk/wordpress.org/public_html/style/trac/wp-trac.js

    r11539 r11540  
    699699
    700700                reports: function() {
    701                         var popup = $( '#report-popup' ), failed = false;
     701                        var popup = $( '#report-popup' ),
     702                                $headline = $( '#headline' ),
     703                                failed = false;
     704
    702705                        $( '#report-popup' ).on( 'change', '.tickets-by-topic', function() {
    703706                                var topic = $(this).val();
     
    708711                                return false;
    709712                        });
     713
    710714                        popup.appendTo( '#main' );
     715
    711716                        $( '.open-ticket-report' ).click( function( event ) {
    712717                                // Allow opening the report on make.
     
    714719                                        return;
    715720                                }
     721
     722                                // Calculate the correct position, even if the header size/etc changes.
     723                                popup.css( 'top', ( $headline.offset().top + $headline.outerHeight() ) + 'px' );
    716724
    717725                                if ( popup.children().length === 0 ) {
Note: See TracChangeset for help on using the changeset viewer.