summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-03 02:46:59 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-03 02:46:59 +0000
commit7fae338f7391ffc2aaed0b809322332f36569818 (patch)
treef2eed2fca8b3a60cd2c0dd6a0d93418db3d9746a
parent336224ac47dd932386feb83e06f525d34754b3f1 (diff)
downloadchromium_src-7fae338f7391ffc2aaed0b809322332f36569818.zip
chromium_src-7fae338f7391ffc2aaed0b809322332f36569818.tar.gz
chromium_src-7fae338f7391ffc2aaed0b809322332f36569818.tar.bz2
ntp4: when you drag a most visited tile off the NTP, make sure it shows up again
in its original location this doesn't fix bug 94854 but it does fix the glitch seen in the screenshot BUG=94854 TEST=manual Review URL: http://codereview.chromium.org/7737006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99519 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/resources/ntp4/apps_page.js2
-rw-r--r--chrome/browser/resources/ntp4/tile_page.js6
2 files changed, 5 insertions, 3 deletions
diff --git a/chrome/browser/resources/ntp4/apps_page.js b/chrome/browser/resources/ntp4/apps_page.js
index 9ba9dc0..4ae2843 100644
--- a/chrome/browser/resources/ntp4/apps_page.js
+++ b/chrome/browser/resources/ntp4/apps_page.js
@@ -499,7 +499,7 @@ cr.define('ntp4', function() {
chrome.send('uninstallApp', [this.appData_.id, true]);
this.tile.tilePage.cleanupDrag();
- this.tile.parentNode.removeChild(tile);
+ this.tile.parentNode.removeChild(this.tile);
},
/**
diff --git a/chrome/browser/resources/ntp4/tile_page.js b/chrome/browser/resources/ntp4/tile_page.js
index b188ca5..7c43581 100644
--- a/chrome/browser/resources/ntp4/tile_page.js
+++ b/chrome/browser/resources/ntp4/tile_page.js
@@ -146,8 +146,6 @@ cr.define('ntp4', function() {
* @private
*/
onDragEnd_: function(e) {
- // The drag clone can still be hidden from the last drag move event.
- this.dragClone.classList.remove('hidden');
this.dragClone.classList.add('placing');
setCurrentlyDraggingTile(null);
@@ -161,6 +159,8 @@ cr.define('ntp4', function() {
this.dragClone.classList.add('deleting');
} else if (this.tilePage) {
if (this.tilePage.selected && e.dataTransfer.dropEffect != 'copy') {
+ // The drag clone can still be hidden from the last drag move event.
+ this.dragClone.classList.remove('hidden');
// The tile's contents may have moved following the respositioning;
// adjust for that.
var contentDiffX = this.dragClone.firstChild.offsetLeft -
@@ -172,6 +172,8 @@ cr.define('ntp4', function() {
this.dragClone.style.top =
(this.gridY + this.parentNode.getBoundingClientRect().top -
contentDiffY) + 'px';
+ } else if (this.dragClone.classList.contains('hidden')) {
+ this.finalizeDrag_();
} else {
this.dragClone.classList.add('dropped-on-other-page');
}