Hello,
I have a radcontextmenu that targets a RadDock and I'm trying to make the right click work for ipad. I saw the implementation in a radtree, but I'm trying to adopt it without success.
Thanks,
Rod
I have a radcontextmenu that targets a RadDock and I'm trying to make the right click work for ipad. I saw the implementation in a radtree, but I'm trying to adopt it without success.
Thanks,
Rod
function pageLoad() { var isMobileSafari = (navigator.userAgent.search(/like\sMac\sOS\sX;.*Mobile\/\S+/) != -1) if (isMobileSafari) { var ctx = document.getElementById("<%= RadDock1.ClientID "%>); ctx.addEventListener('touchstart', handleTouchStart, false); ctx.addEventListener('touchend', handleTouchEnd, false); } } var lastContext = null; var longTouchID = 0; var menuShown = false; function longTouch() { longTouchID = 0; menuShown = true; var ctx = document.getElementById("<%= radMenu1.ClientID "%>); ctx.show(); } function handleTouchStart(e) { longTouchID = setTimeout(longTouch, 1000); } function handleClick(e) { if (menuShown) { menuShown = false; document.body.removeEventListener('click', handleClick, true); e.stopPropagation(); e.preventDefault(); } } function handleTouchEnd(e) { if (longTouchID != 0) clearTimeout(longTouchID); if (menuShown) { document.body.addEventListener('click', handleClick, true); e.preventDefault(); } }