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

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

Issue 7889002: Normalizing .dropEffect across platforms (specifically Windows). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: incorporating csilv's changes Created 9 years, 3 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/drag_wrapper.js ('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/tile_page.js
diff --git a/chrome/browser/resources/ntp4/tile_page.js b/chrome/browser/resources/ntp4/tile_page.js
index cf3a3bbdd3fd2c0714002e45b9ebaffb8136800f..120976008741cc47546e5e0405accb1622a3785e 100644
--- a/chrome/browser/resources/ntp4/tile_page.js
+++ b/chrome/browser/resources/ntp4/tile_page.js
@@ -151,14 +151,18 @@ cr.define('ntp4', function() {
setCurrentlyDraggingTile(null);
// tilePage will be null if we've already been removed.
- if (this.tilePage)
- this.tilePage.positionTile_(this.index);
+ var tilePage = this.tilePage;
+ if (tilePage)
+ tilePage.positionTile_(this.index);
// Take an appropriate action with the drag clone.
if (this.landedOnTrash) {
this.dragClone.classList.add('deleting');
- } else if (this.tilePage) {
- if (this.tilePage.selected && e.dataTransfer.dropEffect != 'copy') {
+ } else if (tilePage) {
+ // TODO(dbeam): Until we fix dropEffect to the correct behavior it will
+ // differ on windows - crbug.com/39399. That's why we use the custom
+ // tilePage.lastDropEffect_ instead of e.dataTransfer.dropEffect.
+ if (tilePage.selected && tilePage.lastDropEffect_ != 'copy') {
// The drag clone can still be hidden from the last drag move event.
this.dragClone.hidden = false;
// The tile's contents may have moved following the respositioning;
@@ -927,6 +931,8 @@ cr.define('ntp4', function() {
if (newDragIndex < 0 || newDragIndex >= this.tileElements_.length)
newDragIndex = this.dragItemIndex_;
this.updateDropIndicator_(newDragIndex);
+
+ this.lastDropEffect_ = e.dataTransfer.dropEffect;
},
/**
« no previous file with comments | « chrome/browser/resources/ntp4/drag_wrapper.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698