| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 }); |
| OLD | NEW |