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

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

Issue 7951011: Moving where I'm doing dropEffect normalization. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: code review changes from conversation with estade over chat 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/nav_dot.js ('k') | chrome/browser/resources/ntp4/trash.js » ('j') | 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 b5ed39d6c18e17969c7e5bb833022ddcd671d2c8..8d8fbb6028666a2daef9cebeb94b816bb705a5da 100644
--- a/chrome/browser/resources/ntp4/tile_page.js
+++ b/chrome/browser/resources/ntp4/tile_page.js
@@ -18,6 +18,11 @@ cr.define('ntp4', function() {
else
ntp4.leaveRearrangeMode();
}
csilv 2011/09/20 19:05:34 Add a linefeed here.
Dan Beam 2011/09/20 23:00:21 Done.
+ function setCurrentDropEffect(dataTransfer, effect) {
+ dataTransfer.dropEffect = effect;
+ if (currentlyDraggingTile)
+ currentlyDraggingTile.lastDropEffect = dataTransfer.dropEffect;
Evan Stade 2011/09/21 21:58:29 = effect
Dan Beam 2011/09/21 23:28:38 I did this to filter out bad values. Do you not w
Evan Stade 2011/09/21 23:56:27 oh right, you said that before. I never deleted my
+ }
/**
* Creates a new Tile object. Tiles wrap content on a TilePage, providing
@@ -161,8 +166,8 @@ cr.define('ntp4', function() {
} 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') {
+ // this.lastDropEffect instead of e.dataTransfer.dropEffect.
+ if (tilePage.selected && this.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;
@@ -183,6 +188,7 @@ cr.define('ntp4', function() {
}
}
+ delete this.lastDropEffect;
this.landedOnTrash = false;
},
@@ -934,8 +940,6 @@ cr.define('ntp4', function() {
if (newDragIndex < 0 || newDragIndex >= this.tileElements_.length)
newDragIndex = this.dragItemIndex_;
this.updateDropIndicator_(newDragIndex);
-
- this.lastDropEffect_ = e.dataTransfer.dropEffect;
},
/**
@@ -1074,6 +1078,7 @@ cr.define('ntp4', function() {
return {
getCurrentlyDraggingTile: getCurrentlyDraggingTile,
+ setCurrentDropEffect: setCurrentDropEffect,
TilePage: TilePage,
};
});
« no previous file with comments | « chrome/browser/resources/ntp4/nav_dot.js ('k') | chrome/browser/resources/ntp4/trash.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698