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

Unified Diff: chrome/browser/resources/ntp/drag_drop_controller.js

Issue 6264012: [NTP] Tweak app drag and drop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/browser/resources
Patch Set: fix js error and scrolling Created 9 years, 11 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
Index: chrome/browser/resources/ntp/drag_drop_controller.js
diff --git a/chrome/browser/resources/ntp/drag_drop_controller.js b/chrome/browser/resources/ntp/drag_drop_controller.js
index fe604a41ee9ee583829280cc8e9c4d5209c65a33..2fcf324c91f340d5a1a50e191109a8e35ffd11a9 100644
--- a/chrome/browser/resources/ntp/drag_drop_controller.js
+++ b/chrome/browser/resources/ntp/drag_drop_controller.js
@@ -71,8 +71,10 @@ DragAndDropController.prototype = {
// starting drag and drop.
handleMouseDown_: function(e) {
var item = this.delegate_.getItem(e);
- if (!item)
+ if (!item) {
+ e.preventDefault();
return;
+ }
this.startX_ = item.offsetLeft;
this.startY_ = item.offsetTop;
@@ -96,6 +98,7 @@ DragAndDropController.prototype = {
// url-list. Instead, we just rely on the dragging of link behavior.
this.delegate_.dragItem = item;
item.classList.add('dragging');
+ item.style.zIndex = 2;
e.dataTransfer.effectAllowed = 'copyLinkMove';
},
@@ -127,9 +130,10 @@ DragAndDropController.prototype = {
this.delegate_.dragItem = null;
this.delegate_.saveDrag();
+ dragItem.classList.remove('dragging');
setTimeout(function() {
- dragItem.classList.remove('dragging');
+ dragItem.style.zIndex = 0;
}, this.delegate_.transitionsDuration + 10);
},
« chrome/browser/resources/ntp/apps.js ('K') | « chrome/browser/resources/ntp/apps.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698