JGonera has submitted this change and it was merged.
Change subject: On settings page allow touchstart to move checkbox
......................................................................
On settings page allow touchstart to move checkbox
Many demos have revealed people expect to be able to swipe these
This gives the illusion that this has the desired effect.
Change-Id: Ifd0cdf679fce42a2b6c2831690a9cc9ae33d7fba
---
M javascripts/specials/mobileoptions.js
1 file changed, 6 insertions(+), 2 deletions(-)
Approvals:
JGonera: Verified; Looks good to me, approved
jenkins-bot: Checked
diff --git a/javascripts/specials/mobileoptions.js
b/javascripts/specials/mobileoptions.js
index 57fd96e..340da7e 100644
--- a/javascripts/specials/mobileoptions.js
+++ b/javascripts/specials/mobileoptions.js
@@ -1,4 +1,7 @@
( function( $ ) {
+ function supportsTouchEvents() {
+ return 'ontouchstart' in window;
+ }
function enhanceCheckboxes() {
@@ -16,8 +19,9 @@
}
$( '.mw-mf-checkbox-css3 > input[type=checkbox]' ).each(
function( i, el ) {
- var $parent = $( el ).parent();
- $parent.on( 'click', clickChkBox );
+ var $parent = $( el ).parent(),
+ eventName = supportsTouchEvents() ?
'touchstart' : 'click';
+ $parent.on( eventName, clickChkBox );
if ( el.checked ) {
$parent.addClass( 'checked ');
}
--
To view, visit https://gerrit.wikimedia.org/r/59013
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifd0cdf679fce42a2b6c2831690a9cc9ae33d7fba
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits