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

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

Issue 6992011: ntp4: fix one more small dragging glitch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 7 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 | « no previous file | 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 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');
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698