0

I have in code following libraries:

<script type="text/javascript" src="http://localhost/js/lib/jquery/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="http://localhost/js/lib/jquery/noconflict.js"></script>
<script type="text/javascript" src="http://localhost/js/prototype/prototype.js"></script>
<script type="text/javascript" src="http://localhost/js/mage/cookies.js"></script>
<script type="text/javascript" src="http://localhost/js/mage/translate.js"></script>
<script type="text/javascript" src="http://localhost/js/lib/lodash/lodash.min.js"></script>
<script type="text/javascript" src="http://localhost/js/lib/momentjs/moment.min.js"></script>
<script type="text/javascript" src="http://localhost/js/lib/slick/slick.min.js"></script>
<script type="text/javascript" src="http://localhost/js/lib/noUislider/nouislider.js"></script>

And I have a problem with a slider on mobiles. On PC's it works well but on mobiles, touching doesn't work (on the phone and on PC dev tools also). When I touch some point on slider button moves to this position but I get the error message (one time) in the console:

Uncaught TypeError: this.each is not a function at TouchList.findAll (prototype.js:883) at fixEvent (nouislider.js:1473) at HTMLDivElement.method (nouislider.js:1387)

When I try to drag button and slide it to side, button doesn't move but in consolthe e I get error above but two times (same error).

It looks like the problem is somewhere libraries nouislider.js and prototype.js. If I disable prototype.js for moment, slider working fine. Because prototype.js is necessary in project to other feature I need to solve this problem. Any idea how to do it?

I am not best in JS but job must be done so I really need help.

Thanks in advance.

1

3 Answers 3

0

Problem solved.

I removed prototype.js from templates where the conflict appears by

jspath_to_library/prototype.js

in xml file. It was enough this time.

0

I simply added:

TouchList.prototype.each = Array.prototype.each; TouchList.prototype._each = Array.prototype._each;

to noUislider.min.js at beginning and seems to have fixed my issue(s).

0

I've fixed this issue by upgrading prototype.js to its latest version.

https://ajax.googleapis.com/ajax/libs/prototype/1.7.3.0/prototype.js

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.