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 1e431d7599f5b3774cec4a550047438f0028f3b6..1c82cf69fa2490c81cf63a960ba1a164e9278aa4 100644 |
--- a/chrome/browser/resources/ntp4/tile_page.js |
+++ b/chrome/browser/resources/ntp4/tile_page.js |
@@ -447,7 +447,7 @@ cr.define('ntp4', function() { |
var offTheRight = col == layout.numRowTiles || |
(col == layout.numRowTiles - 1 && tile.hasDoppleganger()); |
var offTheLeft = col == -1 || (col == 0 && tile.hasDoppleganger()); |
- if (this.dragEnters_ > 0 && (offTheRight || offTheLeft)) { |
+ if (this.isCurrentDragTarget_ && (offTheRight || offTheLeft)) { |
var sign = offTheRight ? 1 : -1; |
tile.showDoppleganger(-layout.numRowTiles * layout.colWidth * sign, |
layout.rowHeight * sign); |
@@ -506,7 +506,7 @@ cr.define('ntp4', function() { |
* @private |
*/ |
updateMask_: function() { |
- if (this.dragEnters_ == 0) { |
+ if (!this.isCurrentDragTarget_) { |
this.style.WebkitMaskBoxImage = ''; |
return; |
} |
@@ -691,17 +691,17 @@ cr.define('ntp4', function() { |
this.isCurrentDragTarget_ = false; |
var index = this.currentDropIndex_; |
- if ((index == this.dragItemIndex_) && this.withinPageDrag_) |
- return; |
- |
- var adjustedIndex = this.currentDropIndex_ + |
- (index > this.dragItemIndex_ ? 1 : 0); |
- if (TilePage.currentlyDraggingTile) { |
- this.tileGrid_.insertBefore( |
- TilePage.currentlyDraggingTile, |
- this.tileElements_[adjustedIndex]); |
- } else { |
- this.addOutsideData(e.dataTransfer, adjustedIndex); |
+ // Only change data if this was not a 'null drag'. |
+ if (!((index == this.dragItemIndex_) && this.withinPageDrag_)) { |
+ var adjustedIndex = this.currentDropIndex_ + |
+ (index > this.dragItemIndex_ ? 1 : 0); |
+ if (TilePage.currentlyDraggingTile) { |
+ this.tileGrid_.insertBefore( |
+ TilePage.currentlyDraggingTile, |
+ this.tileElements_[adjustedIndex]); |
+ } else { |
+ this.addOutsideData(e.dataTransfer, adjustedIndex); |
+ } |
} |
this.classList.remove('animating-tile-page'); |