Skip to content

Commit 989f720

Browse files
committed
Dropped built-in fast-click support in favor of modern touch-action property (closes dimsemenov#447, dimsemenov#158)
1 parent 31b574e commit 989f720

File tree

4 files changed

+4
-103
lines changed

4 files changed

+4
-103
lines changed

Gruntfile.js

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ module.exports = function(grunt) {
6060
'iframe',
6161
'gallery',
6262
'retina',
63-
'fastclick'
6463
],
6564
basePath: 'src/js/',
6665
dest: 'dist/jquery.magnific-popup.js',

src/css/main.scss

+1
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ button {
217217
padding: 0;
218218
z-index: $mfp-z-index-base + 6;
219219
box-shadow: none;
220+
touch-action: manipulation;
220221
}
221222
&::-moz-focus-inner {
222223
padding: 0;

src/js/fastclick.js

-93
This file was deleted.

src/js/gallery.js

+3-9
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ $.magnificPopup.registerModule('gallery', {
3232
initGallery: function() {
3333

3434
var gSt = mfp.st.gallery,
35-
ns = '.mfp-gallery',
36-
supportsFastClick = Boolean($.fn.mfpFastClick);
35+
ns = '.mfp-gallery';
3736

3837
mfp.direction = true; // true - next, false - prev
3938

@@ -78,11 +77,10 @@ $.magnificPopup.registerModule('gallery', {
7877
arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),
7978
arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS);
8079

81-
var eName = supportsFastClick ? 'mfpFastClick' : 'click';
82-
arrowLeft[eName](function() {
80+
arrowLeft.click(function() {
8381
mfp.prev();
8482
});
85-
arrowRight[eName](function() {
83+
arrowRight.click(function() {
8684
mfp.next();
8785
});
8886

@@ -111,10 +109,6 @@ $.magnificPopup.registerModule('gallery', {
111109
_mfpOn(CLOSE_EVENT+ns, function() {
112110
_document.off(ns);
113111
mfp.wrap.off('click'+ns);
114-
115-
if(mfp.arrowLeft && supportsFastClick) {
116-
mfp.arrowLeft.add(mfp.arrowRight).destroyMfpFastClick();
117-
}
118112
mfp.arrowRight = mfp.arrowLeft = null;
119113
});
120114

0 commit comments

Comments
 (0)