Making WordPress.org

Changeset 7065


Ignore:
Timestamp:
04/09/2018 03:37:38 AM (6 years ago)
Author:
dd32
Message:

Trac: Don't double up the comment deletion buttons.

This needs a follow up once all Tracs are migrated to remove this block of code / the extra template changes.

See #3526.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/style/trac/wp-trac.js

    r6895 r7065  
    176176            // See https://meta.trac.wordpress.org/changeset/204.
    177177            $('div.change').children('.trac-ticket-buttons').each( function() {
    178                 var el = $(this);
    179                 el.children().appendTo( el.prev().children('.trac-ticket-buttons') ).end().end().remove();
     178                var el = $(this),
     179                    trac_buttons = el.prev().children('.trac-ticket-buttons');
     180
     181                // Trac 1.2.2 already has a delete button here. TODO See r204 to check if buttons need removing from templates.
     182                if ( trac_buttons.find('form input[name="action"][value="delete-comment"]').length ) {
     183                    console.log( "wp-trac: .trac-ticket-buttons delete-comment changes not needed on this trac." );
     184                    return;
     185                }
     186
     187                el.children().appendTo( trac_buttons ).end().end().remove();
    180188            });
    181189        },
Note: See TracChangeset for help on using the changeset viewer.