| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 }, | 56 }, |
| 57 | 57 |
| 58 /** | 58 /** |
| 59 * Drop handler. | 59 * Drop handler. |
| 60 * @param {Event} e The drag event. | 60 * @param {Event} e The drag event. |
| 61 */ | 61 */ |
| 62 doDrop: function(e) { | 62 doDrop: function(e) { |
| 63 e.preventDefault(); | 63 e.preventDefault(); |
| 64 | 64 |
| 65 var tile = ntp4.getCurrentlyDraggingTile(); | 65 var tile = ntp4.getCurrentlyDraggingTile(); |
| 66 var page = tile.tilePage; |
| 66 tile.firstChild.removeFromChrome(); | 67 tile.firstChild.removeFromChrome(); |
| 67 tile.landedOnTrash = true; | 68 tile.landedOnTrash = true; |
| 69 page.cleanupDrag(); |
| 68 }, | 70 }, |
| 69 | 71 |
| 70 /** | 72 /** |
| 71 * Drag leave handler. | 73 * Drag leave handler. |
| 72 * @param {Event} e The drag event. | 74 * @param {Event} e The drag event. |
| 73 */ | 75 */ |
| 74 doDragLeave: function(e) { | 76 doDragLeave: function(e) { |
| 75 ntp4.getCurrentlyDraggingTile().dragClone.classList.remove( | 77 ntp4.getCurrentlyDraggingTile().dragClone.classList.remove( |
| 76 'hovering-on-trash'); | 78 'hovering-on-trash'); |
| 77 }, | 79 }, |
| 78 }; | 80 }; |
| 79 | 81 |
| 80 return { | 82 return { |
| 81 Trash: Trash, | 83 Trash: Trash, |
| 82 }; | 84 }; |
| 83 }); | 85 }); |
| OLD | NEW |