OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** | 7 /** |
8 * Drag selector used on the file list or the grid table. | 8 * Drag selector used on the file list or the grid table. |
9 * TODO(hirono): Support drag selection for grid view. crbug.com/224832 | 9 * TODO(hirono): Support drag selection for grid view. crbug.com/224832 |
10 * @constructor | 10 * @constructor |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
231 * @private | 231 * @private |
232 * @param {MouseEvent} event The mouseup event. | 232 * @param {MouseEvent} event The mouseup event. |
233 */ | 233 */ |
234 DragSelector.prototype.onMouseUp_ = function(event) { | 234 DragSelector.prototype.onMouseUp_ = function(event) { |
235 this.onMouseMove_(event); | 235 this.onMouseMove_(event); |
236 this.target_.removeChild(this.border_); | 236 this.target_.removeChild(this.border_); |
237 this.target_.ownerDocument.removeEventListener( | 237 this.target_.ownerDocument.removeEventListener( |
238 'mousemove', this.onMouseMoveBound_, true); | 238 'mousemove', this.onMouseMoveBound_, true); |
239 this.target_.ownerDocument.removeEventListener( | 239 this.target_.ownerDocument.removeEventListener( |
240 'mouseup', this.onMouseUpBound_, true); | 240 'mouseup', this.onMouseUpBound_, true); |
241 this.target_.dispatchEvent(new Event('dragselectionend')); | |
yoshiki
2013/06/20 03:11:25
Is it possible to use cr.dispatchSimpleEvent(this.
hirono
2013/06/20 03:55:03
Done.
| |
241 this.target_.cachedBounds = null; | 242 this.target_.cachedBounds = null; |
243 this.target_ = null; | |
244 // The target may select an item by reacting to the mouseup event. | |
245 // This surpress to the selecting behavior. | |
242 event.stopPropagation(); | 246 event.stopPropagation(); |
243 this.target_ = null; | |
244 }; | 247 }; |
OLD | NEW |