Closed ArmanGrewal closed 7 years ago
@FEDuser can you provide a jsFiddle reproducing the problem?
Can you modify this - https://jsfiddle.net/opc0q95o/ - to show how you use the new Event
constructor and how it affects mootools?
Here is the scenario - https://jsbin.com/pahibazamu/edit?html,output Third party js is using new Event("something") and It is creating issue in mootools library.
This is most likely caused by the fact that you're using MooTools Core with compatibility additions for older versions, you have to choose between compatibility with old MooTools or compliance with newer standards.
Back when MooTools 1.3 was released, there was no native Event object, and MooTools defined its own. In 1.4 MooTools Core's Event object was renamed to DOMEvent.
The Native Event object is overwritten by the compatibility functionality, to make sure MooTools Core is compatible with version 1.3 in this case.
If you do not need compatibility with old MooTools versions, you should not use the "compat" version. You only need the "compat" version if your code is old and/or relies on old code.
Thank you. It makes sense. How Can I download nocompat version from https://github.com/mootools/mootools-core/tree/master/Source?
@FEDuser together with the release tag there is a /dist/
folder.
You can find it here: https://github.com/mootools/mootools-core/tree/1.6.0/dist
You can also visit the website and download from there: https://mootools.net/core
Probably easier, you can download it on https://mootools.net/core, or you can build your own version with only what you need on https://mootools.net/core/builder.
Additionally, the CDN you used in your example also distributes the no-compat version:
And so does Google:
I want to download a whole folder structure rather than one js file/ cdn js file. Is there any way to download folder structure nocompact version? something like - https://github.com/mootools/mootools-core/tree/master/Source
There is no file/directory structure without compatibility additions. The compatibility additions are stripped in the packaging/building process.
If you want all source files separately with compatibility stripped, you'll have to do it yourself. You can do that manually, reconfigure (or even adapt) the packager to your needs, or you can try and see if it's doable with the currently available tools.
Perhaps the Advanced Building and Testing part of the README can help.
It's not actually supported, though, and you'll probably be doing a bunch of manual things to get this done.
Hi timwienk,
I have one quick question for you. If we use to no compat version, then are we loosing any old browser support(eg: IE8, old safari browsers..)?
Thanks, Armandeep
no, just compatibility with old MooTools API.
-- Dimitar Christoff
"JavaScript is to JAVA what hamster is to ham" @D_mitar - https://github.com/DimitarChristoff
Hi,
On using new Event (https://developer.mozilla.org/en-US/docs/Web/API/Event/Event) api in independent js file. mootools Event class code is failing on if(type.indexOf('key')==0).
Thanks