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

Unified Diff: chrome/browser/resources/ntp4/trash.js

Issue 7572041: ntp4: polish app trashing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/ntp4/tile_page.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/ntp4/trash.js
diff --git a/chrome/browser/resources/ntp4/trash.js b/chrome/browser/resources/ntp4/trash.js
index 2502601128c598a761d4a8846321cbe6ec50bf1f..e554e2eceb0e09a86a23b363e2d5a4e586e998b6 100644
--- a/chrome/browser/resources/ntp4/trash.js
+++ b/chrome/browser/resources/ntp4/trash.js
@@ -29,7 +29,15 @@ cr.define('ntp4', function() {
* @return {bool}
*/
shouldAcceptDrag: function(e) {
- return !!ntp4.getCurrentlyDraggingTile().querySelector('.app');
+ var tile = ntp4.getCurrentlyDraggingTile();
+ if (!tile)
+ return false;
+
+ var app = tile.querySelector('.app');
+ if (!app)
+ return false;
+
+ return app.appData.can_uninstall;
},
/**
@@ -37,6 +45,8 @@ cr.define('ntp4', function() {
* @param {Event} e The drag event.
*/
doDragOver: function(e) {
+ ntp4.getCurrentlyDraggingTile().dragClone.classList.add(
+ 'hovering-on-trash');
e.preventDefault();
e.dataTransfer.dropEffect = 'move';
},
@@ -73,6 +83,8 @@ cr.define('ntp4', function() {
* @param {Event} e The drag event.
*/
doDragLeave: function(e) {
+ ntp4.getCurrentlyDraggingTile().dragClone.classList.remove(
+ 'hovering-on-trash');
},
};
« no previous file with comments | « chrome/browser/resources/ntp4/tile_page.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698