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

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

Issue 7685049: ntp4: app install improvements (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rbyers suggestions Created 9 years, 4 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/ntp4/new_tab.js ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/ntp4/tile_page.js
diff --git a/chrome/browser/resources/ntp4/tile_page.js b/chrome/browser/resources/ntp4/tile_page.js
index 4a490452bf6269d6e07ac4fc549b3cd3e57787c2..d99451528b3ee7ba98d5d7520a30580c13853ea2 100644
--- a/chrome/browser/resources/ntp4/tile_page.js
+++ b/chrome/browser/resources/ntp4/tile_page.js
@@ -161,7 +161,7 @@ cr.define('ntp4', function() {
if (this.landedOnTrash) {
this.dragClone.classList.add('deleting');
} else if (this.tilePage) {
- if (this.tilePage.selected) {
+ if (this.tilePage.selected && e.dataTransfer.dropEffect != 'copy') {
// The tile's contents may have moved following the respositioning;
// adjust for that.
var contentDiffX = this.dragClone.firstChild.offsetLeft -
@@ -903,11 +903,7 @@ cr.define('ntp4', function() {
doDragOver: function(e) {
e.preventDefault();
- if (currentlyDraggingTile)
- e.dataTransfer.dropEffect = 'move';
- else
- e.dataTransfer.dropEffect = 'copy';
-
+ this.setDropEffect(e.dataTransfer);
var newDragIndex = this.getWouldBeIndexForPoint_(e.pageX, e.pageY);
if (newDragIndex < 0 || newDragIndex >= this.tileElements_.length)
newDragIndex = this.dragItemIndex_;
@@ -1030,6 +1026,15 @@ cr.define('ntp4', function() {
*/
tileMoved: function(draggedTile) {
},
+
+ /**
+ * Sets the drop effect on |dataTransfer| to the desired value (e.g.
+ * 'copy').
+ * @param {Object} dataTransfer The drag event dataTransfer object.
+ */
+ setDropEffect: function(dataTransfer) {
+ assert(false);
+ },
};
return {
« no previous file with comments | « chrome/browser/resources/ntp4/new_tab.js ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698