Skip to content

Commit 00c74c3

Browse files
committed
AC-1709: Fix Unit tests
- Reverted changes
1 parent c4ffa83 commit 00c74c3

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

app/code/Magento/Theme/view/base/requirejs-config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ var config = {
7474
'jquery/jquery-migrate'
7575
],
7676
config: {
77+
mixins: {
78+
'jquery': {
79+
'jquery/patches/jquery': true
80+
}
81+
},
7782
text: {
7883
'headers': {
7984
'X-Requested-With': 'XMLHttpRequest'

lib/web/jquery/patches/jquery.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([], function () {
7+
'use strict';
8+
9+
return function ($) {
10+
$.event.special.touchstart = {
11+
setup: function( _, ns, handle ) {
12+
this.addEventListener("touchstart", handle, { passive: !ns.includes("noPreventDefault") });
13+
}
14+
};
15+
16+
$.event.special.touchmove = {
17+
setup: function( _, ns, handle ) {
18+
this.addEventListener("touchmove", handle, { passive: !ns.includes("noPreventDefault") });
19+
}
20+
};
21+
22+
$.event.special.wheel = {
23+
setup: function( _, ns, handle ){
24+
this.addEventListener("wheel", handle, { passive: true });
25+
}
26+
};
27+
28+
$.event.special.mousewheel = {
29+
setup: function( _, ns, handle ){
30+
this.addEventListener("mousewheel", handle, { passive: true });
31+
}
32+
};
33+
34+
return $;
35+
};
36+
});

0 commit comments

Comments
 (0)