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

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

Issue 7969027: ntp4: drag from bookmark page to apps page (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: disallow folder drags Created 9 years, 3 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 | no next file » | 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 26b8fae0d2807f71874f5aba6f37619b2bef7804..f27dcfaaf160ac2767aed7126c566ac0e0698910 100644
--- a/chrome/browser/resources/ntp4/apps_page.js
+++ b/chrome/browser/resources/ntp4/apps_page.js
@@ -628,7 +628,11 @@ cr.define('ntp4', function() {
/** @inheritDoc */
shouldAcceptDrag: function(e) {
- return ntp4.getCurrentlyDraggingTile() ||
+ var tile = ntp4.getCurrentlyDraggingTile();
+ if (tile.querySelector('.bookmark'))
+ return !!tile.firstChild.data.url;
+
+ return tile ||
(e.dataTransfer && e.dataTransfer.types.indexOf('url') != -1);
},
@@ -642,7 +646,8 @@ cr.define('ntp4', function() {
currentlyDraggingTile,
this.tileElements_[index]);
this.tileMoved(currentlyDraggingTile);
- } else if (currentlyDraggingTile.querySelector('.most-visited')) {
+ } else if (currentlyDraggingTile.querySelector(
+ '.most-visited, .bookmark')) {
this.generateAppForLink(tileContents.data);
}
} else {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698