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

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 another scrolling issue 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
« no previous file with comments | « chrome/browser/resources/ntp/apps.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c2954346ea555b4e46a2e3f00bf2cf7fa8003c9f 100644
--- a/chrome/browser/resources/ntp/drag_drop_controller.js
+++ b/chrome/browser/resources/ntp/drag_drop_controller.js
@@ -55,8 +55,8 @@ DragAndDropController.prototype = {
getCoordinates_: function(e) {
var rect = this.delegate_.dragContainer.getBoundingClientRect();
var coordinates = {
- x: e.clientX + window.scrollX - rect.left,
- y: e.clientY + window.scrollY - rect.top
+ x: e.clientX - rect.left,
+ y: e.clientY - rect.top
};
// If we're in an RTL language, reflect the coordinates so the delegate
@@ -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);
},
« no previous file with comments | « chrome/browser/resources/ntp/apps.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698