OLD | NEW |
1 // Copyright 2014 The ChromeOS IME Authors. All Rights Reserved. | 1 // Copyright 2014 The ChromeOS IME Authors. All Rights Reserved. |
2 // limitations under the License. | 2 // limitations under the License. |
3 // See the License for the specific language governing permissions and | 3 // See the License for the specific language governing permissions and |
4 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 4 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
5 // distributed under the License is distributed on an "AS-IS" BASIS, | 5 // distributed under the License is distributed on an "AS-IS" BASIS, |
6 // Unless required by applicable law or agreed to in writing, software | 6 // Unless required by applicable law or agreed to in writing, software |
7 // | 7 // |
8 // http://www.apache.org/licenses/LICENSE-2.0 | 8 // http://www.apache.org/licenses/LICENSE-2.0 |
9 // | 9 // |
10 // You may obtain a copy of the License at | 10 // You may obtain a copy of the License at |
11 // you may not use this file except in compliance with the License. | 11 // you may not use this file except in compliance with the License. |
12 // Licensed under the Apache License, Version 2.0 (the "License"); | 12 // Licensed under the Apache License, Version 2.0 (the "License"); |
13 // | 13 // |
14 goog.provide('i18n.input.chrome.inputview.handler.PointerHandler'); | 14 goog.provide('i18n.input.chrome.inputview.handler.PointerHandler'); |
15 | 15 |
16 goog.require('goog.Timer'); | 16 goog.require('goog.Timer'); |
17 goog.require('goog.events.EventHandler'); | 17 goog.require('goog.events.EventHandler'); |
18 goog.require('goog.events.EventTarget'); | 18 goog.require('goog.events.EventTarget'); |
19 goog.require('goog.events.EventType'); | 19 goog.require('goog.events.EventType'); |
20 goog.require('goog.math.Coordinate'); | 20 goog.require('goog.math.Coordinate'); |
| 21 goog.require('i18n.input.chrome.inputview.events.PointerEvent'); |
21 goog.require('i18n.input.chrome.inputview.handler.PointerActionBundle'); | 22 goog.require('i18n.input.chrome.inputview.handler.PointerActionBundle'); |
22 | 23 |
23 goog.scope(function() { | 24 goog.scope(function() { |
24 | 25 |
25 | 26 |
26 | 27 |
27 /** | 28 /** |
28 * The pointer controller. | 29 * The pointer controller. |
29 * | 30 * |
30 * @param {!Element=} opt_target . | 31 * @param {!Element=} opt_target . |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 } | 178 } |
178 } else { | 179 } else { |
179 var view = Util.getView(/** @type {!Node} */ (e.target)); | 180 var view = Util.getView(/** @type {!Node} */ (e.target)); |
180 if (!view) { | 181 if (!view) { |
181 return; | 182 return; |
182 } | 183 } |
183 pointerActionBundle = this.pointerActionBundles_[goog.getUid(view)]; | 184 pointerActionBundle = this.pointerActionBundles_[goog.getUid(view)]; |
184 if (pointerActionBundle) { | 185 if (pointerActionBundle) { |
185 pointerActionBundle.handlePointerUp(e); | 186 pointerActionBundle.handlePointerUp(e); |
186 } | 187 } |
| 188 e.preventDefault(); |
187 } | 189 } |
188 e.preventDefault(); | |
189 if (pointerActionBundle && pointerActionBundle.view && | 190 if (pointerActionBundle && pointerActionBundle.view && |
190 pointerActionBundle.view.pointerConfig.stopEventPropagation) { | 191 pointerActionBundle.view.pointerConfig.stopEventPropagation) { |
191 e.stopPropagation(); | 192 e.stopPropagation(); |
192 } | 193 } |
193 }; | 194 }; |
194 | 195 |
195 | 196 |
196 /** | 197 /** |
197 * Callback for touchmove or mousemove. | 198 * Callback for touchmove or mousemove. |
198 * | 199 * |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 PointerHandler.prototype.disposeInternal = function() { | 245 PointerHandler.prototype.disposeInternal = function() { |
245 for (var bundle in this.pointerActionBundles_) { | 246 for (var bundle in this.pointerActionBundles_) { |
246 goog.dispose(bundle); | 247 goog.dispose(bundle); |
247 } | 248 } |
248 goog.dispose(this.eventHandler_); | 249 goog.dispose(this.eventHandler_); |
249 | 250 |
250 goog.base(this, 'disposeInternal'); | 251 goog.base(this, 'disposeInternal'); |
251 }; | 252 }; |
252 | 253 |
253 }); // goog.scope | 254 }); // goog.scope |
OLD | NEW |