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

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

Issue 7799015: ntp4: some appearance fixes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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/apps_page.js ('k') | chrome/browser/resources/ntp4/nav_dot.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/ntp4/drag_wrapper.js
diff --git a/chrome/browser/resources/ntp4/drag_wrapper.js b/chrome/browser/resources/ntp4/drag_wrapper.js
index b3fb53a7cca4d200da8f199572cd80da1b7b68c1..a2add2dc706b856ec3e4b6ac0308e3680de208c1 100644
--- a/chrome/browser/resources/ntp4/drag_wrapper.js
+++ b/chrome/browser/resources/ntp4/drag_wrapper.js
@@ -38,7 +38,7 @@ var DragWrapper = (function() {
* is incremented by |onDragEnter_| and decremented by |onDragLeave_|. This
* is necessary because dragging over child widgets will fire additional
* enter and leave events on |this|. A non-zero value does not necessarily
- * indicate that |isCurrentDragTarget_| is true.
+ * indicate that |isCurrentDragTarget()| is true.
* @type {number}
* @private
*/
@@ -48,11 +48,9 @@ var DragWrapper = (function() {
* Whether the tile page is currently being dragged over with data it can
* accept.
* @type {boolean}
- * @private
*/
- isCurrentDragTarget_: false,
get isCurrentDragTarget() {
- return this.isCurrentDragTarget_;
+ return this.target_.classList.contains('drag-target');
},
/**
@@ -63,7 +61,7 @@ var DragWrapper = (function() {
onDragEnter_: function(e) {
if (++this.dragEnters_ == 1) {
if (this.handler_.shouldAcceptDrag(e)) {
- this.isCurrentDragTarget_ = true;
+ this.target_.classList.add('drag-target');
this.handler_.doDragEnter(e);
}
} else {
@@ -82,7 +80,7 @@ var DragWrapper = (function() {
* @private
*/
onDragOver_: function(e) {
- if (!this.isCurrentDragTarget_)
+ if (!this.target_.classList.contains('drag-target'))
return;
this.handler_.doDragOver(e);
},
@@ -94,9 +92,9 @@ var DragWrapper = (function() {
*/
onDrop_: function(e) {
this.dragEnters_ = 0;
- if (!this.isCurrentDragTarget_)
+ if (!this.target_.classList.contains('drag-target'))
return;
- this.isCurrentDragTarget_ = false;
+ this.target_.classList.remove('drag-target');
this.handler_.doDrop(e);
},
@@ -109,7 +107,7 @@ var DragWrapper = (function() {
if (--this.dragEnters_ > 0)
return;
- this.isCurrentDragTarget_ = false;
+ this.target_.classList.remove('drag-target');
this.handler_.doDragLeave();
},
};
« no previous file with comments | « chrome/browser/resources/ntp4/apps_page.js ('k') | chrome/browser/resources/ntp4/nav_dot.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698