diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-05 18:45:07 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-05 18:45:07 +0000 |
commit | 0465236cf9932785a35d82ebc0374553ec852173 (patch) | |
tree | 9d7d379b51731eab14759377157b931f509cf326 | |
parent | 066bfa567a00da8cdaf86daf2b88490c0fa6ae9e (diff) | |
download | chromium_src-0465236cf9932785a35d82ebc0374553ec852173.zip chromium_src-0465236cf9932785a35d82ebc0374553ec852173.tar.gz chromium_src-0465236cf9932785a35d82ebc0374553ec852173.tar.bz2 |
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
-rw-r--r-- | chrome/browser/resources/ntp4/tile_page.css | 5 | ||||
-rw-r--r-- | chrome/browser/resources/ntp4/trash.js | 14 |
2 files changed, 18 insertions, 1 deletions
diff --git a/chrome/browser/resources/ntp4/tile_page.css b/chrome/browser/resources/ntp4/tile_page.css index 37d9897..4b1c87f 100644 --- a/chrome/browser/resources/ntp4/tile_page.css +++ b/chrome/browser/resources/ntp4/tile_page.css @@ -73,6 +73,7 @@ pointer-events: none; position: fixed; z-index: 3; + -webkit-transition: opacity 0.2s; } .tile.drag-representation.placing > * { @@ -89,6 +90,10 @@ -webkit-transition: left 200ms, right 200ms, top 200ms; } +.hovering-on-trash { + opacity: 0.6; +} + .animating-tile-page .top-margin { -webkit-transition: margin-bottom 200ms; } diff --git a/chrome/browser/resources/ntp4/trash.js b/chrome/browser/resources/ntp4/trash.js index 2502601..e554e2e 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'); }, }; |