Exclude redlink clicks from modalEditClicked event

This event is meant to track attempts to edit the page we are on,
but also happened to catch clicks on "see talk page" links, in
case that talk page doesn't exist yet.

Bug: T204073
Change-Id: I1a471f81cc9390fc9e8665a7a336cf2dd7a063ab
This commit is contained in:
T. Bayer 2018-09-12 04:26:21 -07:00 committed by Stephen Niedzielski
parent 8ac5b9c663
commit 287a2aafe9

View file

@ -60,7 +60,9 @@
*/
events: util.extend( {}, Overlay.prototype.events, {
'click a:not(.external):not([href*=edit])': 'onInternalClick',
'click a[href*="edit"]': 'onEditClick'
// Only register attempts to edit an existing page (should be the one we are on),
// not internal clicks on redlinks to nonexistent pages:
'click a[href*="edit"]:not([href*=redlink])': 'onEditClick'
} ),
/**
@ -123,6 +125,7 @@
* Event that is triggered when an edit link inside the overlay is clicked. This is
* primarily used for instrumenting page issues (see
* https://meta.wikimedia.org/wiki/Schema:PageIssues).
* The event will not be triggered in the case of red links.
* @param {JQuery.Event} ev
* @memberof PageIssuesOverlay
* @instance