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() { |
11 'use strict'; | 11 'use strict'; |
12 | 12 |
13 function Trash(trash) { | 13 function Trash(trash) { |
14 trash.__proto__ = Trash.prototype; | 14 trash.__proto__ = Trash.prototype; |
15 trash.initialize(); | 15 trash.initialize(); |
16 return trash; | 16 return trash; |
17 } | 17 } |
18 | 18 |
19 Trash.prototype = { | 19 Trash.prototype = { |
20 __proto__: HTMLDivElement.prototype, | 20 __proto__: HTMLDivElement.prototype, |
21 | 21 |
22 initialize: function(element) { | 22 initialize: function(element) { |
23 this.dragWrapper_ = new DragWrapper(this, this); | 23 this.dragWrapper_ = new cr.ui.DragWrapper(this, this); |
24 }, | 24 }, |
25 | 25 |
26 /** | 26 /** |
27 * Determines whether we are interested in the drag data for |e|. | 27 * Determines whether we are interested in the drag data for |e|. |
28 * @param {Event} e The event from drag enter. | 28 * @param {Event} e The event from drag enter. |
29 * @return {bool} | 29 * @return {bool} |
30 */ | 30 */ |
31 shouldAcceptDrag: function(e) { | 31 shouldAcceptDrag: function(e) { |
32 var tile = ntp4.getCurrentlyDraggingTile(); | 32 var tile = ntp4.getCurrentlyDraggingTile(); |
33 if (!tile) | 33 if (!tile) |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 doDragLeave: function(e) { | 74 doDragLeave: function(e) { |
75 ntp4.getCurrentlyDraggingTile().dragClone.classList.remove( | 75 ntp4.getCurrentlyDraggingTile().dragClone.classList.remove( |
76 'hovering-on-trash'); | 76 'hovering-on-trash'); |
77 }, | 77 }, |
78 }; | 78 }; |
79 | 79 |
80 return { | 80 return { |
81 Trash: Trash, | 81 Trash: Trash, |
82 }; | 82 }; |
83 }); | 83 }); |
OLD | NEW |