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

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

Issue 6992009: ntp4: Fix a couple small visual glitches with tile dragging. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: whitespace Created 9 years, 7 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.css ('k') | no next file » | 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 1e431d7599f5b3774cec4a550047438f0028f3b6..d1cb0226d46ffc44cdeabeae4d4ccd7f41223c52 100644
--- a/chrome/browser/resources/ntp4/tile_page.js
+++ b/chrome/browser/resources/ntp4/tile_page.js
@@ -99,6 +99,13 @@ cr.define('ntp4', function() {
* @private
*/
onDragMove_: function(e) {
+ if (e.view != window || (e.pageX == 0 && e.pageY == 0)) {
+ // attribute hidden seems to be overridden by display.
+ this.dragClone.classList.add('hidden');
+ return;
+ }
+
+ this.dragClone.classList.remove('hidden');
this.dragClone.style.left = (e.pageX - this.dragOffsetX) + 'px';
this.dragClone.style.top = (e.pageY - this.dragOffsetY) + 'px';
},
@@ -175,12 +182,14 @@ cr.define('ntp4', function() {
* @param {Event} e The transition end event.
*/
onDragCloneTransitionEnd_: function(e) {
- var clone = this.dragClone;
- this.dragClone = null;
+ if (e.propertyName == 'left') {
+ var clone = this.dragClone;
+ this.dragClone = null;
- clone.parentNode.removeChild(clone);
- this.eventTracker.remove(clone, 'webkitTransitionEnd');
- this.classList.remove('dragging');
+ clone.parentNode.removeChild(clone);
+ this.eventTracker.remove(clone, 'webkitTransitionEnd');
+ this.classList.remove('dragging');
+ }
}
};
« no previous file with comments | « chrome/browser/resources/ntp4/new_tab.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698