Giter Site home page Giter Site logo

jsplumb / mottle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sporritt/mottle

29.0 29.0 15.0 167 KB

mouse event helper - maps touch events to mouse events, and provides "smart" click functionality

HTML 26.92% JavaScript 69.86% CSS 3.23%

mottle's Introduction

mottle's People

Contributors

sguiheux avatar sporritt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mottle's Issues

document.createTouch deprecated in Chrome

from this issue on jsplumb

https://github.com/jsplumb/jsplumb/issues/738

I am receiving the following warnings on Chrome 66 and jsplumb@^2.6.9:

[Deprecation] document.createTouch is deprecated and will be removed in M68, around July 2018. 
Please use TouchEvent constructor instead. 
See https://www.chromestatus.com/features/5668612064935936 for more details. jsplumb.js:1175

[Deprecation] document.createTouchList is deprecated and will be removed in M68, around July 2018. 
Please use TouchEvent constructor instead. 
See https://www.chromestatus.com/features/5668612064935936 for more details. jsplumb.js:1180

source code

you have replaced the js source code with the jsplumb source

Support devices with both touchscreen and mouse

Due to the fact that Mottle thinks the device is a touchscreen device. Mottle uses this test:

isTouchDevice = "ontouchstart" in document.documentElement

which returns true. This is touched upon here:

http://www.stucox.com/blog/you-cant-detect-a-touchscreen/

and in other places. The suggestion that testing for a touch device is wrong is misguided: Mottle needs to know which actual event to bind to.

A possible solution is to bind to both the touch events and the mouse events, but introduce some code that "knows" when one or other of these is a duplicate of an event that has already occurred. I don't know if this is possible or not.

A related situation with Mottle's touch/mouse discrimination is that right now if you have a device that has both a mouse and a touchscreen - not uncommon in windows 8 - then mouse events do not work (but touch events do). This would of course be fixed (in theory) by listening for both types of events.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.