, script contextmenu 1,5 . .
: - , . 1500 1200 , .
(function() {
var EM = Ext.EventManager,
body = document.body,
activeTouches = {},
onTouchStart = function(e, t) {
var be = e.browserEvent;
Ext.id(t);
if(be.touches.length === 1) {
activeTouches[t.id] = fireContextMenu.defer(1200, null, [e, t]);
} else {
cancelContextMenu(e, t);
}
},
fireContextMenu = function(e, t) {
var touch = e.browserEvent.touches[0];
var me = document.createEvent("MouseEvents");
me.initMouseEvent("contextmenu", true, true, window,
1,
touch.screenX,
touch.screenY,
touch.clientX,
touch.clientY,
false, false, false, false,
2,
null
);
t.dispatchEvent(me);
},
cancelContextMenu = function(e, t) {
clearTimeout(activeTouches[t.id]);
};
if(navigator.userAgent.match(/iPad/i) != null) {
Ext.onReady(function() {
EM.on(body, "touchstart", onTouchStart);
EM.on(body, "touchmove", cancelContextMenu);
EM.on(body, "touchend", cancelContextMenu);
});
}
})();