Page MenuHomePhabricator

Do not change targets to javascript:void(0); on JavaScript load for various "edit" links
Closed, ResolvedPublic

Description

Instead, call event.preventDefault() on their onclick event.

Otherwise, with JavaScript loaded, midclicking the link (= open a new tab) creates a new empty page at javascript:void(0);.


Version: master
Severity: normal

Details

Reference
bz56090

Related Objects

StatusAssignedTask
ResolvedNone
OpenNone
ResolvedNone
ResolvedNone
ResolvedNone
ResolvedNone
Resolvedadrianheine
ResolvedNone
ResolvedNone
ResolvedNone
OpenNone
ResolvedNone
ResolvedNone
ResolvedNone
ResolvedNone
ResolvedNone
ResolvedNone
Resolvedthiemowmde
ResolvedNone
DeclinedNone
Resolvedthiemowmde
DeclinedLydia_Pintscher
DeclinedNone
OpenNone
Resolvedthiemowmde
InvalidNone
DeclinedNone
OpenNone
Openthiemowmde
Resolvedadrianheine
Resolvedadrianheine
Resolvedadrianheine
ResolvedNone
Resolvedadrianheine
InvalidNone
Declined Jonas
ResolvedNone
Resolvedadrianheine
Resolvedadrianheine
Invalidthiemowmde
Resolvedadrianheine
Resolvedthiemowmde
OpenNone
OpenNone
StalledNone
ResolvedLea_Lacroix_WMDE
ResolvedLucas_Werkmeister_WMDE
ResolvedLucas_Werkmeister_WMDE
Resolvedmatej_suchanek
ResolvedLea_Lacroix_WMDE

Event Timeline

bzimport raised the priority of this task from to Low.
bzimport set Reference to bz56090.
bzimport added a subscriber: Unknown Object (MLST).

As far as I can tell, the targets aren't actually changed. Instead, every single edit link on the page is actually removed/deleted. ($( 'td.wb-editsection' ).empty(); $( 'span.wb-editsection, div.wb-editsection' ).remove(); in wikibase.ui.entityViewInit.js) New ones, frequently hundreds of them, are built from scratch later on, with the target as javascript:void(0). That's probably awful for performance.

Lydia_Pintscher removed a subscriber: Unknown Object (MLST).
Lydia_Pintscher removed a subscriber: Unknown Object (MLST).
He7d3r updated the task description. (Show Details)Dec 1 2014, 3:03 PM
He7d3r added a project: good first bug.
He7d3r set Security to None.

While the linked change is an improvement, I would prefer to use buttons for elements which don't link somewhere (aka don't work without JS).

Linked change is merged. Are there more of these?

Snaterlicious closed this task as Resolved.Jan 29 2015, 8:29 AM
Snaterlicious claimed this task.
Snaterlicious removed Snaterlicious as the assignee of this task.
adrianheine raised the priority of this task from Low to High.