Fomafix has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/369530 )
Change subject: ListToggle: Avoid href="#" for JavaScript buttons
......................................................................
ListToggle: Avoid href="#" for JavaScript buttons
<a href="#"> is problematic because it allows to open a new tab on
middleclick and it shows a status line.
Change-Id: Id8d7f79a2894693a82f86ae46900e6f0aecba4f3
---
M includes/ListToggle.php
M resources/src/mediawiki/mediawiki.checkboxtoggle.js
2 files changed, 4 insertions(+), 7 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/30/369530/1
diff --git a/includes/ListToggle.php b/includes/ListToggle.php
index 2c87b8b..7a5fd9a 100644
--- a/includes/ListToggle.php
+++ b/includes/ListToggle.php
@@ -42,7 +42,7 @@
private function checkboxLink( $checkboxType ) {
return Html::element(
// CSS classes: mw-checkbox-all, mw-checkbox-none,
mw-checkbox-invert
- 'a', [ 'href' => '#', 'class' => 'mw-checkbox-' .
$checkboxType ],
+ 'a', [ 'class' => 'mw-checkbox-' . $checkboxType,
'role' => 'button', 'tabindex' => 0 ],
$this->output->msg( 'checkbox-' . $checkboxType
)->text()
);
}
diff --git a/resources/src/mediawiki/mediawiki.checkboxtoggle.js
b/resources/src/mediawiki/mediawiki.checkboxtoggle.js
index 901f875..36090ea 100644
--- a/resources/src/mediawiki/mediawiki.checkboxtoggle.js
+++ b/resources/src/mediawiki/mediawiki.checkboxtoggle.js
@@ -21,16 +21,13 @@
$checkboxes.prop( 'checked', check );
}
- $( '.mw-checkbox-all' ).click( function ( e ) {
- e.preventDefault();
+ $( '.mw-checkbox-all' ).click( function () {
selectAll( true );
} );
- $( '.mw-checkbox-none' ).click( function ( e ) {
- e.preventDefault();
+ $( '.mw-checkbox-none' ).click( function () {
selectAll( false );
} );
- $( '.mw-checkbox-invert' ).click( function ( e ) {
- e.preventDefault();
+ $( '.mw-checkbox-invert' ).click( function () {
$checkboxes.prop( 'checked', function ( i, val ) {
return !val;
} );
--
To view, visit https://gerrit.wikimedia.org/r/369530
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id8d7f79a2894693a82f86ae46900e6f0aecba4f3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Fomafix <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits