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

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

Issue 2977523002: MD Bookmarks: Scroll and select items that are added to the main list (Closed)
Patch Set: Fix test Created 3 years, 5 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
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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 */ 349 */
350 onDrop_: function(e) { 350 onDrop_: function(e) {
351 if (this.dropDestination_) { 351 if (this.dropDestination_) {
352 e.preventDefault(); 352 e.preventDefault();
353 353
354 var dropInfo = this.calculateDropInfo_(this.dropDestination_); 354 var dropInfo = this.calculateDropInfo_(this.dropDestination_);
355 if (dropInfo.index != -1) 355 if (dropInfo.index != -1)
356 chrome.bookmarkManagerPrivate.drop(dropInfo.parentId, dropInfo.index); 356 chrome.bookmarkManagerPrivate.drop(dropInfo.parentId, dropInfo.index);
357 else 357 else
358 chrome.bookmarkManagerPrivate.drop(dropInfo.parentId); 358 chrome.bookmarkManagerPrivate.drop(dropInfo.parentId);
359
360 if (isBookmarkItem(this.dropDestination_.element) ||
361 isBookmarkList(this.dropDestination_.element)) {
362 bookmarks.ApiListener.highlightAfterBatchUpdate();
363 }
359 } 364 }
360 365
361 this.dropDestination_ = null; 366 this.dropDestination_ = null;
362 this.dropIndicator_.finish(); 367 this.dropIndicator_.finish();
363 }, 368 },
364 369
365 /** 370 /**
366 * @param {DropDestination} dropDestination 371 * @param {DropDestination} dropDestination
367 * @return {{parentId: string, index: number}} 372 * @return {{parentId: string, index: number}}
368 */ 373 */
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 return this.chip_; 689 return this.chip_;
685 }, 690 },
686 }; 691 };
687 692
688 return { 693 return {
689 DNDManager: DNDManager, 694 DNDManager: DNDManager,
690 DragInfo: DragInfo, 695 DragInfo: DragInfo,
691 DropIndicator: DropIndicator, 696 DropIndicator: DropIndicator,
692 }; 697 };
693 }); 698 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698