OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 /** | 5 /** |
6 * @fileoverview Trash | 6 * @fileoverview Trash |
7 * This is the class for the trash can that appears when dragging an app. | 7 * This is the class for the trash can that appears when dragging an app. |
8 */ | 8 */ |
9 | 9 |
10 cr.define('ntp4', function() { | 10 cr.define('ntp4', function() { |
(...skipping 25 matching lines...) Expand all Loading... |
36 return tile.firstChild.canBeRemoved(); | 36 return tile.firstChild.canBeRemoved(); |
37 }, | 37 }, |
38 | 38 |
39 /** | 39 /** |
40 * Drag over handler. | 40 * Drag over handler. |
41 * @param {Event} e The drag event. | 41 * @param {Event} e The drag event. |
42 */ | 42 */ |
43 doDragOver: function(e) { | 43 doDragOver: function(e) { |
44 ntp4.getCurrentlyDraggingTile().dragClone.classList.add( | 44 ntp4.getCurrentlyDraggingTile().dragClone.classList.add( |
45 'hovering-on-trash'); | 45 'hovering-on-trash'); |
| 46 ntp4.setCurrentDropEffect(e.dataTransfer, 'move'); |
46 e.preventDefault(); | 47 e.preventDefault(); |
47 e.dataTransfer.dropEffect = 'move'; | |
48 }, | 48 }, |
49 | 49 |
50 /** | 50 /** |
51 * Drag enter handler. | 51 * Drag enter handler. |
52 * @param {Event} e The drag event. | 52 * @param {Event} e The drag event. |
53 */ | 53 */ |
54 doDragEnter: function(e) { | 54 doDragEnter: function(e) { |
55 this.doDragOver(e); | 55 this.doDragOver(e); |
56 }, | 56 }, |
57 | 57 |
(...skipping 18 matching lines...) Expand all Loading... |
76 doDragLeave: function(e) { | 76 doDragLeave: function(e) { |
77 ntp4.getCurrentlyDraggingTile().dragClone.classList.remove( | 77 ntp4.getCurrentlyDraggingTile().dragClone.classList.remove( |
78 'hovering-on-trash'); | 78 'hovering-on-trash'); |
79 }, | 79 }, |
80 }; | 80 }; |
81 | 81 |
82 return { | 82 return { |
83 Trash: Trash, | 83 Trash: Trash, |
84 }; | 84 }; |
85 }); | 85 }); |
OLD | NEW |