Skip to content
This repository
Browse code

Clean up

  • Loading branch information...
commit e6fca8aa15fa71f35e7451a6c96d5944aafc8706 1 parent ad9b8db
David Aurelio davidaurelio authored

Showing 1 changed file with 11 additions and 7 deletions. Show diff stats Hide diff stats

  1. +11 7 src/renderer/dom/event_handler.js
18 src/renderer/dom/event_handler.js
@@ -89,7 +89,7 @@ function(tools) {
89 89 forEach(eventTypesForDocument, function(eventType) {
90 90 document.removeEventListener(eventType, this, false);
91 91 });
92   - }
  92 + },
93 93
94 94 handleEvent: function(domEvent) {
95 95 var renderer = this.renderer;
@@ -147,24 +147,28 @@ function(tools) {
147 147 }
148 148 this.isMultiTouch = this.hadTouchMove = this.hadTouchCancel = false;
149 149 }
150   - } else if (isKeyboardEventType(domEventType)) {
  150 + }
  151 + } else if (isKeyboardEventType(domEventType)) {
151 152 //TODO: check this bailout
152 153 // if (!target || target._isBSDOMElement || ownerDocument.activeElement === ownerDocument.body) {} else {
153 154 // // There is another currently focused element (outside of the stage), exit:
154 155 // return;
155 156 // }
156   - var keyboardEvent = KeyboardEvent.fromDomKeyboardEvent(domEvent);
157   - this.emit('userevent', keyboardEvent, targetId);
158   - }
  157 + var keyboardEvent = KeyboardEvent.fromDomKeyboardEvent(domEvent);
  158 + this.emit('userevent', keyboardEvent, targetId);
159 159 }
160 160 },
161 161
  162 + handleMouseEvent: function(pointerEvent, targetId, relatedTargetId) {
  163 +
  164 + },
  165 +
162 166 triggerClickFromTouch: function(domEvent, pointerEvent) {
163   - var clickType, domTimeStamp = domEvent.timeStamp;
  167 + var domTimeStamp = domEvent.timeStamp;
164 168 var isDoubleClick = domTimeStamp - this.lastClickFromTouchTime < 300;
165 169 var clickType = isDoubleClick ? 'dblclick' : 'click';
166 170 this.lastClickFromTouchTime = isDoubleClick ? 0 : domTimeStamp;
167   - emitMouseEvent(this.renderer, pointerEvent.clone(clickType), touchTargetId);
  171 + this.renderer.emit('userevent', pointerEvent.clone(clickType), touchTargetId);
168 172 }
169 173 };
170 174

0 comments on commit e6fca8a

Please sign in to comment.
Something went wrong with that request. Please try again.