Index: chrome/browser/resources/ntp4/apps_page.js |
diff --git a/chrome/browser/resources/ntp4/apps_page.js b/chrome/browser/resources/ntp4/apps_page.js |
index e5f2fe7309a4cccd7d985b4095c0401c03b965d5..27b0c007df86c2bd5f4593ba90a276d379593576 100644 |
--- a/chrome/browser/resources/ntp4/apps_page.js |
+++ b/chrome/browser/resources/ntp4/apps_page.js |
@@ -663,8 +663,9 @@ cr.define('ntp', function() { |
* Similar to appendApp, but it respects the app_launch_ordinal field of |
* |appData|. |
* @param {Object} appData The data that describes the app. |
+ * @param {boolean} animate Whether to animate the insertion. |
*/ |
- insertApp: function(appData) { |
+ insertApp: function(appData, animate) { |
var index = this.tileElements_.length; |
for (var i = 0; i < this.tileElements_.length; i++) { |
if (appData.app_launch_ordinal < |
@@ -674,7 +675,7 @@ cr.define('ntp', function() { |
} |
} |
- this.addTileAt(new App(appData), index, false); |
+ this.addTileAt(new App(appData), index, animate); |
}, |
/** |
@@ -750,12 +751,13 @@ cr.define('ntp', function() { |
/** @inheritDoc */ |
doDragOver: function(e) { |
+ // Only animatedly re-arrange if the user is currently dragging an app. |
var tile = ntp.getCurrentlyDraggingTile(); |
- if (tile && !tile.querySelector('.app')) { |
+ if (tile && tile.querySelector('.app')) { |
+ TilePage.prototype.doDragOver.call(this, e); |
+ } else { |
e.preventDefault(); |
this.setDropEffect(e.dataTransfer); |
- } else { |
- TilePage.prototype.doDragOver.call(this, e); |
} |
}, |