MCPcopy
hub / github.com/ampproject/amphtml / onTouchDetected

Method onTouchDetected

src/input.js:111–116  ·  view source on GitHub ↗

* Registers an event handle in case if the touch is detected. * @param {function(boolean)} handler * @param {boolean=} opt_fireImmediately * @return {!UnlistenDef}

(handler, opt_fireImmediately)

Source from the content-addressed store, hash-verified

109 * @return {!UnlistenDef}
110 */
111 onTouchDetected(handler, opt_fireImmediately) {
112 if (opt_fireImmediately) {
113 handler(this.isTouchDetected());
114 }
115 return this.touchDetectedObservable_.add(handler);
116 }
117
118 /**
119 * Whether the mouse input has been detected.

Callers 2

setupInputModeClassesMethod · 0.95
test-input.jsFile · 0.80

Calls 3

isTouchDetectedMethod · 0.95
handlerFunction · 0.50
addMethod · 0.45

Tested by

no test coverage detected