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

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

Issue 11635038: Should not unregister BookmarkTreeItem from lookup table on handling moved event (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 2012-12-25T13:37 Created 7 years, 12 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 /** @const */ var Tree = cr.ui.Tree; 7 /** @const */ var Tree = cr.ui.Tree;
8 /** @const */ var TreeItem = cr.ui.TreeItem; 8 /** @const */ var TreeItem = cr.ui.TreeItem;
9 9
10 var treeLookup = {}; 10 var treeLookup = {};
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 draggable: bookmarkNode.parentId != ROOT_ID 95 draggable: bookmarkNode.parentId != ROOT_ID
96 }); 96 });
97 ti.__proto__ = BookmarkTreeItem.prototype; 97 ti.__proto__ = BookmarkTreeItem.prototype;
98 treeLookup[bookmarkNode.id] = ti; 98 treeLookup[bookmarkNode.id] = ti;
99 return ti; 99 return ti;
100 } 100 }
101 101
102 BookmarkTreeItem.prototype = { 102 BookmarkTreeItem.prototype = {
103 __proto__: TreeItem.prototype, 103 __proto__: TreeItem.prototype,
104 104
105 /** @override */
106 remove: function(child) {
107 TreeItem.prototype.remove.call(this, child);
108 if (child.bookmarkNode)
109 delete treeLookup[child.bookmarkNode.id];
110 },
111
112 /** 105 /**
113 * The ID of the bookmark this tree item represents. 106 * The ID of the bookmark this tree item represents.
114 * @type {string} 107 * @type {string}
115 */ 108 */
116 get bookmarkId() { 109 get bookmarkId() {
117 return this.bookmarkNode.id; 110 return this.bookmarkNode.id;
118 } 111 }
119 }; 112 };
120 113
121 /** 114 /**
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 } 280 }
288 }; 281 };
289 282
290 return { 283 return {
291 BookmarkTree: BookmarkTree, 284 BookmarkTree: BookmarkTree,
292 BookmarkTreeItem: BookmarkTreeItem, 285 BookmarkTreeItem: BookmarkTreeItem,
293 treeLookup: treeLookup, 286 treeLookup: treeLookup,
294 tree: tree 287 tree: tree
295 }; 288 };
296 }); 289 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698