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

Side by Side Diff: chrome/browser/resources/bookmark_manager/js/bmm/bookmarklist.js

Issue 646076: Bookmark manager drag and drop frontend (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 5
6 cr.define('bmm', function() { 6 cr.define('bmm', function() {
7 // require cr.ui.define 7 // require cr.ui.define
8 // require cr.ui.limitInputWidth. 8 // require cr.ui.limitInputWidth.
9 // require cr.ui.contextMenuHandler 9 // require cr.ui.contextMenuHandler
10 const List = cr.ui.List; 10 const List = cr.ui.List;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 cr.dispatchPropertyChange(this, 'parentId', parentId, oldParentId); 54 cr.dispatchPropertyChange(this, 'parentId', parentId, oldParentId);
55 }, 55 },
56 56
57 handleBookmarkCallback: function(items) { 57 handleBookmarkCallback: function(items) {
58 if (!items) { 58 if (!items) {
59 // Failed to load bookmarks. Most likely due to the bookmark beeing 59 // Failed to load bookmarks. Most likely due to the bookmark beeing
60 // removed. 60 // removed.
61 cr.dispatchSimpleEvent(this, 'invalidId'); 61 cr.dispatchSimpleEvent(this, 'invalidId');
62 return; 62 return;
63 } 63 }
64 listLookup = {}; 64 // Remove all fields without recreating the object since other code
65 // references it.
66 for (var id in listLookup){
67 delete listLookup[id];
68 }
65 this.clear(); 69 this.clear();
66 var showFolder = this.showFolder(); 70 var showFolder = this.showFolder();
67 items.forEach(function(item) { 71 items.forEach(function(item) {
68 var li = createListItem(item, showFolder); 72 var li = createListItem(item, showFolder);
69 this.add(li); 73 this.add(li);
70 }, this); 74 }, this);
71 cr.dispatchSimpleEvent(this, 'load'); 75 cr.dispatchSimpleEvent(this, 'load');
72 }, 76 },
73 77
74 /** 78 /**
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 '<div><span class=folder></span></div>' + 376 '<div><span class=folder></span></div>' +
373 '</div>'; 377 '</div>';
374 return div.firstChild; 378 return div.firstChild;
375 })(); 379 })();
376 380
377 return { 381 return {
378 BookmarkList: BookmarkList, 382 BookmarkList: BookmarkList,
379 listLookup: listLookup 383 listLookup: listLookup
380 }; 384 };
381 }); 385 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698