| 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 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 if (isBookmarkList(overElement)) { | 619 if (isBookmarkList(overElement)) { |
| 620 var state = bookmarks.Store.getInstance().data; | 620 var state = bookmarks.Store.getInstance().data; |
| 621 return state.selectedFolder && | 621 return state.selectedFolder && |
| 622 state.nodes[state.selectedFolder].children.length == 0; | 622 state.nodes[state.selectedFolder].children.length == 0; |
| 623 } | 623 } |
| 624 | 624 |
| 625 // We can only drop on a folder. | 625 // We can only drop on a folder. |
| 626 if (getBookmarkNode(overElement).url) | 626 if (getBookmarkNode(overElement).url) |
| 627 return false; | 627 return false; |
| 628 | 628 |
| 629 return !this.dragInfo_.isDraggingChildBookmark(overElement.itemId) | 629 return !this.dragInfo_.isDraggingChildBookmark(overElement.itemId); |
| 630 }, | 630 }, |
| 631 | 631 |
| 632 disableTimeoutsForTesting: function() { | 632 disableTimeoutsForTesting: function() { |
| 633 this.setTimeout_ = function(fn) { | 633 this.setTimeout_ = function(fn) { |
| 634 fn(); | 634 fn(); |
| 635 }; | 635 }; |
| 636 this.dropIndicator_.setTimeout = this.setTimeout_; | 636 this.dropIndicator_.setTimeout = this.setTimeout_; |
| 637 } | 637 } |
| 638 }; | 638 }; |
| 639 | 639 |
| 640 return { | 640 return { |
| 641 DNDManager: DNDManager, | 641 DNDManager: DNDManager, |
| 642 DragInfo: DragInfo, | 642 DragInfo: DragInfo, |
| 643 DropIndicator: DropIndicator, | 643 DropIndicator: DropIndicator, |
| 644 }; | 644 }; |
| 645 }); | 645 }); |
| OLD | NEW |