Making WordPress.org

Changeset 5907


Ignore:
Timestamp:
09/11/2017 10:35:11 AM (7 years ago)
Author:
SergeyBiryukov
Message:

Trac: Prevent marking a ticket as a duplicate of itself.

Fixes #305.

File:
1 edited

Legend:

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

    r5906 r5907  
    409409            }
    410410
     411            // Prevent marking a ticket as a duplicate of itself
     412            $('#propertyform').submit( function() {
     413                var action = $('input[name="action"]:checked').val(),
     414                    currentTicket = parseInt( $('.trac-id').text().replace('#', '') ),
     415                    duplicateTicket = parseInt( $('#action_dupe').val() );
     416
     417                if ( 'duplicate' === action && ( ! duplicateTicket || currentTicket === duplicateTicket ) ) {
     418                    $('#action_dupe').val('')
     419                    return false;
     420                }
     421            });
     422
    411423            // Add a 'Show only commits/attachments' view option to tickets
    412424            $('label[for="trac-comments-only-toggle"]').text('Show only comment text');
Note: See TracChangeset for help on using the changeset viewer.