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

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

Issue 10388134: [NTP4] Fix appmarklet animation drop bug. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: estade review / behavior change Created 8 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 | chrome/browser/resources/ntp4/page_list_view.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
},
« no previous file with comments | « no previous file | chrome/browser/resources/ntp4/page_list_view.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698