diff options
Diffstat (limited to 'chrome/browser/resources')
-rw-r--r-- | chrome/browser/resources/ntp/apps.js | 5 | ||||
-rw-r--r-- | chrome/browser/resources/ntp/drag_drop_controller.js | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/chrome/browser/resources/ntp/apps.js b/chrome/browser/resources/ntp/apps.js index 39ef895..935eebf 100644 --- a/chrome/browser/resources/ntp/apps.js +++ b/chrome/browser/resources/ntp/apps.js @@ -524,10 +524,11 @@ var apps = (function() { this.scrollMouseXY_ = null; }, - saveDrag: function() { + saveDrag: function(draggedItem) { this.invalidate_(); this.layout(); + var draggedAppId = draggedItem.querySelector('a').getAttribute('app-id'); var appIds = this.data.filter(function(id) { return id != 'web-store-entry'; }); @@ -535,7 +536,7 @@ var apps = (function() { // Wait until the transitions are complete before notifying the browser. // Otherwise, the apps will be re-rendered while still transitioning. setTimeout(function() { - chrome.send('reorderApps', appIds); + chrome.send('reorderApps', [draggedAppId, appIds]); }, this.transitionsDuration + 10); }, diff --git a/chrome/browser/resources/ntp/drag_drop_controller.js b/chrome/browser/resources/ntp/drag_drop_controller.js index affa9de..92aaebd 100644 --- a/chrome/browser/resources/ntp/drag_drop_controller.js +++ b/chrome/browser/resources/ntp/drag_drop_controller.js @@ -23,9 +23,10 @@ // tells the delegate that the dragged item is currently above // the specified coordinates. // -// saveDrag() --> +// saveDrag(draggedItem) --> // tells the delegate that the drag is done. move the item to the -// position last specified by setDragPlaceholder. (e.g., commit changes) +// position last specified by setDragPlaceholder (e.g., commit changes). +// draggedItem was the item being dragged. // // The distance, in px, that the mouse must move before initiating a drag. @@ -162,7 +163,7 @@ DragAndDropController.prototype = { return; this.delegate_.dragItem = this.startItem_ = null; - this.delegate_.saveDrag(); + this.delegate_.saveDrag(dragItem); dragItem.classList.remove('dragging'); setTimeout(function() { |