OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 var MAX_DRAG_THUMBAIL_COUNT = 4; | 5 var MAX_DRAG_THUMBAIL_COUNT = 4; |
6 | 6 |
7 function FileTransferController(fileList, | 7 function FileTransferController(fileList, |
8 fileListSelection, | 8 fileListSelection, |
9 dragNodeConstructor, | 9 dragNodeConstructor, |
10 copyManager, | 10 copyManager, |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 } | 33 } |
34 | 34 |
35 FileTransferController.prototype = { | 35 FileTransferController.prototype = { |
36 __proto__: cr.EventTarget.prototype, | 36 __proto__: cr.EventTarget.prototype, |
37 | 37 |
38 /** | 38 /** |
39 * @param {cr.ui.List} list Items in the list will be draggable. | 39 * @param {cr.ui.List} list Items in the list will be draggable. |
40 */ | 40 */ |
41 attachDragSource: function(list) { | 41 attachDragSource: function(list) { |
| 42 list.style.webkitUserDrag = 'element'; |
42 list.addEventListener('dragstart', this.onDragStart_.bind(this, list)); | 43 list.addEventListener('dragstart', this.onDragStart_.bind(this, list)); |
43 list.addEventListener('dragend', this.onDragEnd_.bind(this, list)); | 44 list.addEventListener('dragend', this.onDragEnd_.bind(this, list)); |
44 list.addEventListener('drag', this.onDrag_.bind(this, list)); | 45 list.addEventListener('drag', this.onDrag_.bind(this, list)); |
45 }, | 46 }, |
46 | 47 |
47 /** | 48 /** |
48 * @param {cr.ui.List} list List itself and its directory items will could | 49 * @param {cr.ui.List} list List itself and its directory items will could |
49 * be drop target. | 50 * be drop target. |
50 */ | 51 */ |
51 attachDropTarget: function(list) { | 52 attachDropTarget: function(list) { |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 * @type {Array.<Entry>} | 397 * @type {Array.<Entry>} |
397 */ | 398 */ |
398 get selectedEntries_() { | 399 get selectedEntries_() { |
399 var list = this.fileList_; | 400 var list = this.fileList_; |
400 return this.fileListSelection_.selectedIndexes.map(function(index) { | 401 return this.fileListSelection_.selectedIndexes.map(function(index) { |
401 return list.item(index); | 402 return list.item(index); |
402 }); | 403 }); |
403 } | 404 } |
404 }; | 405 }; |
405 | 406 |
OLD | NEW |