feature(dom) touchstart: set passive listener

https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md
This commit is contained in:
coderaiser 2018-06-12 18:09:55 +03:00
parent aa8916aea5
commit 97c50d588f
2 changed files with 11 additions and 4 deletions

View file

@ -7,6 +7,15 @@ module.exports = new EventsProto();
function EventsProto() {
const Events = this;
const getEventOptions = (eventName) => {
if (eventName !== 'touchstart')
return false;
return {
passive: true
};
};
function parseArgs(eventName, element, listener, callback) {
let isFunc;
const args = [
@ -47,7 +56,7 @@ function EventsProto() {
callback(element, [
eventName,
listener,
false
getEventOptions(eventName),
]);
break;

View file

@ -61,7 +61,7 @@ const EventsFiles = {
]),
dragstart: exec.with(execIfNotUL, onDragStart),
dblclick: exec.with(execIfNotUL, onDblClick),
touchstart: exec.with(execIfNotUL, onTouch)
touchstart: exec.with(execIfNotUL, onTouch),
};
let EXT;
@ -292,8 +292,6 @@ function onTouch(event) {
CloudCmd.loadDir({
path: DOM.getCurrentPath(current)
});
event.preventDefault();
}
/*