Commit graph

4 commits

Author SHA1 Message Date
Fomafix
64d621ac19 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
2017-08-01 22:57:45 +02:00
Timo Tijhof
67849a0e8c mediawiki.checkboxtoggle: Fix minor issues.
Follows-up 606a21c, 79414f8, 870c5e2.

* Mention class name in PHP source. Since there is no obvious link
  between "mediawiki.checkboxtoggle.js" and "ListToggle.php" these
  comments make it possible to find the PHP class. Previously
  these css classes had 0 matches across all source code, thus
  risking accidental removing.

* Quote attribute selector.

* Ensure default prevented before instead of after the handler. These toggles
  have no fallback (href="#"). As such, navigation should be prevented
  regardless of whether the JS fails or succeeds.

* Remove use of is(':checked'). These is no need to reach out to the
  selector engine to determine whether 'checked' property is true or false.
  Instead, use prop('checked') for both getting and setting.

* Simplify code by using this.checked directly instead of $().prop().

* Simplify code by using one loop (from $.prop) instead of two loops
  ($.prop inside $.each). This pattern is also used by selectAll().

Test by using "All", "None" and "Invert" on Special:Log.

Bug: T131318
Change-Id: Idfc43f094c6147d69104416b3f8622eabb20b824
2016-06-13 20:10:20 +00:00
Reedy
1dcfa9acb3 Initialise array with contents in one go
Change-Id: Id9ea7a8f17905a0e1e3c0ff12a9ba6c54de54dbe
2016-02-23 23:39:40 +00:00
Luke Faraone
460ea2524c Add toggle checkboxes to action=history
This breaks out the toggle checkbox code into a separate class in
includes/ListToggle.php

Bug: T92230
Change-Id: I8d1aefb83008053e63d59abf8b8915b93e15fcc2
2016-02-21 20:34:42 +00:00