Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: chrome/browser/resources/ntp4/trash.js

Issue 8786010: NTP4: Dragging app over trash should be more apparent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more review comments Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 this.classList.add('could-drop');
46 ntp4.setCurrentDropEffect(e.dataTransfer, 'move'); 47 ntp4.setCurrentDropEffect(e.dataTransfer, 'move');
47 e.preventDefault(); 48 e.preventDefault();
48 }, 49 },
49 50
50 /** 51 /**
51 * Drag enter handler. 52 * Drag enter handler.
52 * @param {Event} e The drag event. 53 * @param {Event} e The drag event.
53 */ 54 */
54 doDragEnter: function(e) { 55 doDragEnter: function(e) {
55 this.doDragOver(e); 56 this.doDragOver(e);
56 }, 57 },
57 58
58 /** 59 /**
59 * Drop handler. 60 * Drop handler.
60 * @param {Event} e The drag event. 61 * @param {Event} e The drag event.
61 */ 62 */
62 doDrop: function(e) { 63 doDrop: function(e) {
63 e.preventDefault(); 64 e.preventDefault();
64 65
65 var tile = ntp4.getCurrentlyDraggingTile(); 66 var tile = ntp4.getCurrentlyDraggingTile();
66 tile.firstChild.removeFromChrome(); 67 tile.firstChild.removeFromChrome();
67 tile.landedOnTrash = true; 68 tile.landedOnTrash = true;
69 this.classList.remove('could-drop');
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');
79 this.classList.remove('could-drop');
77 }, 80 },
78 }; 81 };
79 82
80 return { 83 return {
81 Trash: Trash, 84 Trash: Trash,
82 }; 85 };
83 }); 86 });
OLDNEW
« chrome/browser/resources/ntp4/new_tab.css ('K') | « chrome/browser/resources/ntp4/new_tab.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698