Commit 0465236c authored by estade@chromium.org's avatar estade@chromium.org

ntp4: polish app trashing

- don't allow un-uninstallable apps to be trashed
- fade effect when dragging over trash

BUG=90894
TEST=manual

Review URL: http://codereview.chromium.org/7572041

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95640 0039d316-1c4b-4281-b951-d872f2087c98
parent 066bfa56
...@@ -73,6 +73,7 @@ ...@@ -73,6 +73,7 @@
pointer-events: none; pointer-events: none;
position: fixed; position: fixed;
z-index: 3; z-index: 3;
-webkit-transition: opacity 0.2s;
} }
.tile.drag-representation.placing > * { .tile.drag-representation.placing > * {
...@@ -89,6 +90,10 @@ ...@@ -89,6 +90,10 @@
-webkit-transition: left 200ms, right 200ms, top 200ms; -webkit-transition: left 200ms, right 200ms, top 200ms;
} }
.hovering-on-trash {
opacity: 0.6;
}
.animating-tile-page .top-margin { .animating-tile-page .top-margin {
-webkit-transition: margin-bottom 200ms; -webkit-transition: margin-bottom 200ms;
} }
......
...@@ -29,7 +29,15 @@ cr.define('ntp4', function() { ...@@ -29,7 +29,15 @@ cr.define('ntp4', function() {
* @return {bool} * @return {bool}
*/ */
shouldAcceptDrag: function(e) { 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() { ...@@ -37,6 +45,8 @@ cr.define('ntp4', function() {
* @param {Event} e The drag event. * @param {Event} e The drag event.
*/ */
doDragOver: function(e) { doDragOver: function(e) {
ntp4.getCurrentlyDraggingTile().dragClone.classList.add(
'hovering-on-trash');
e.preventDefault(); e.preventDefault();
e.dataTransfer.dropEffect = 'move'; e.dataTransfer.dropEffect = 'move';
}, },
...@@ -73,6 +83,8 @@ cr.define('ntp4', function() { ...@@ -73,6 +83,8 @@ cr.define('ntp4', function() {
* @param {Event} e The drag event. * @param {Event} e The drag event.
*/ */
doDragLeave: function(e) { doDragLeave: function(e) {
ntp4.getCurrentlyDraggingTile().dragClone.classList.remove(
'hovering-on-trash');
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment