jinlin
2024-09-26 7ec9326ce00d08f9d957981f2edff6df26f24a28
web/public/SVGOrigin/Method-Draw-master/editor/lib/taphold.js
@@ -12,7 +12,7 @@
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 *
 *  @author Guido Marucci Blas - guido@zaubersoftware.com
 *  @description Adds a handler for a custom event 'taphold' that handles a
 *  tap and hold on touch interfaces.
@@ -45,10 +45,10 @@
            startTapAndHoldDetector.call(this, event)
            var element = $(this);
            element.bind(TOUCHMOVE, onTouchMove);
            element.bind(TOUCHEND, onTouchEnd);
            element.bind(TOUCHEND, onTouchEnd);
        } else {
            stopTapAndHoldDetector.call(this);
        }
        }
    };
    function onTouchMove(event) {
@@ -59,10 +59,10 @@
        var e = event.originalEvent;
        var x = (e.changedTouches) ? e.changedTouches[0].pageX: e.pageX;
        var y = (e.changedTouches) ? e.changedTouches[0].pageY: e.pageY;
        var tapAndHoldPoint = $(this).data("taphold.point");
        var euclideanDistance = calculateEuclideanDistance(tapAndHoldPoint.x, tapAndHoldPoint.y, x, y);
        if (euclideanDistance > MAX_DISTANCE_ALLOWED_IN_TAP_AND_HOLD_EVENT) {
            stopTapAndHoldDetector.call(this);
        }
@@ -80,7 +80,7 @@
    function clear() {
        tapAndHoldTimer = null;
        $(this).unbind(TOUCHMOVE, onTouchMove);
        $(this).unbind(TOUCHEND, onTouchEnd);
        $(this).unbind(TOUCHEND, onTouchEnd);
    };
    function startTapAndHoldDetector(event) {
@@ -102,12 +102,12 @@
    function stopTapAndHoldDetector() {
        clearTimeout(tapAndHoldTimer);
        clear.call(this);
        clear.call(this);
    };
    $.event.special["taphold"] = {
        setup: function() {
        },
        add: function(handleObj) {
@@ -129,8 +129,8 @@
        },
        teardown: function() {
        }
    };
})(jQuery);
})(jQuery);