           }

            document.addEventListener("touchmove", cancelLongpress);
            document.addEventListener("touchend", cancelLongpress);
          };
        }

        /*
         * Touchmove event always fire on the element that got the initial touchstart event.
         * We need the element under the finger to highlight a section though.
         */
        function handleTouchEvents(type, id) {
          return function (e) {
            e.preventDefault();
            e.stopPropagation()