Jdlrobson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/59013
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, 10 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/13/59013/1
diff --git a/javascripts/specials/mobileoptions.js
b/javascripts/specials/mobileoptions.js
index d5b1d83..18510d6 100644
--- a/javascripts/specials/mobileoptions.js
+++ b/javascripts/specials/mobileoptions.js
@@ -1,4 +1,11 @@
( function( $ ) {
+ function supportsTouchEvents() {
+ if ( 'ontouchstart' in window ) {
+ return true;
+ } else {
+ return false;
+ }
+ }
function enhanceCheckboxes() {
@@ -16,8 +23,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: newchange
Gerrit-Change-Id: Ifd0cdf679fce42a2b6c2831690a9cc9ae33d7fba
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits