MCPcopy
hub / github.com/Famous/famous-angular / preventGhostClick

Function preventGhostClick

src/scripts/directives/fa-input.js:148–158  ·  view source on GitHub ↗
(x, y)

Source from the content-addressed store, hash-verified

146 // On the first call, attaches some event handlers. Then whenever it gets called, it creates a
147 // zone around the touchstart where clicks will get busted.
148 function preventGhostClick(x, y) {
149 if (!touchCoordinates) {
150 $rootElement[0].addEventListener('click', onClick, true);
151 $rootElement[0].addEventListener('touchstart', onTouchStart, true);
152 touchCoordinates = [];
153 }
154
155 lastPreventedTime = Date.now();
156
157 checkAllowableRegions(touchCoordinates, x, y);
158 }
159
160 directive.compile = function(element , attrs, transclude) {
161 if($famous.util.isFaElement(element)) {

Callers 1

fa-input.jsFile · 0.85

Calls 1

checkAllowableRegionsFunction · 0.85

Tested by

no test coverage detected