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

Side by Side Diff: chrome/browser/resources/md_bookmarks/dnd_manager.js

Issue 2884233003: [MD Bookmarks] Clear drop indicator when dragging over invalid target. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/test/data/webui/md_bookmarks/dnd_manager_test.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('bookmarks', function() { 5 cr.define('bookmarks', function() {
6 /** 6 /**
7 * @param {BookmarkElement} element 7 * @param {BookmarkElement} element
8 * @return {boolean} 8 * @return {boolean}
9 */ 9 */
10 function isBookmarkItem(element) { 10 function isBookmarkItem(element) {
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 var overElement = getBookmarkElement(e.path); 470 var overElement = getBookmarkElement(e.path);
471 this.autoExpander_.update(e, overElement); 471 this.autoExpander_.update(e, overElement);
472 if (!overElement) 472 if (!overElement)
473 return; 473 return;
474 474
475 475
476 // Now we know that we can drop. Determine if we will drop above, on or 476 // Now we know that we can drop. Determine if we will drop above, on or
477 // below based on mouse position etc. 477 // below based on mouse position etc.
478 this.dropDestination_ = 478 this.dropDestination_ =
479 this.calculateDropDestination_(e.clientY, overElement); 479 this.calculateDropDestination_(e.clientY, overElement);
480 if (!this.dropDestination_) 480 if (!this.dropDestination_) {
481 this.dropIndicator_.finish();
481 return; 482 return;
483 }
482 484
483 if (e.dataTransfer) { 485 if (e.dataTransfer) {
484 e.dataTransfer.dropEffect = 486 e.dataTransfer.dropEffect =
485 this.dragInfo_.isSameProfile() ? 'move' : 'copy'; 487 this.dragInfo_.isSameProfile() ? 'move' : 'copy';
486 } 488 }
487 489
488 this.dropIndicator_.update(this.dropDestination_); 490 this.dropIndicator_.update(this.dropDestination_);
489 }, 491 },
490 492
491 /** 493 /**
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 this.dropIndicator_.setTimeout = this.setTimeout_; 637 this.dropIndicator_.setTimeout = this.setTimeout_;
636 } 638 }
637 }; 639 };
638 640
639 return { 641 return {
640 DNDManager: DNDManager, 642 DNDManager: DNDManager,
641 DragInfo: DragInfo, 643 DragInfo: DragInfo,
642 DropIndicator: DropIndicator, 644 DropIndicator: DropIndicator,
643 }; 645 };
644 }); 646 });
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/webui/md_bookmarks/dnd_manager_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698