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

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

Issue 2905553002: Roll closure compiler (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/resources/md_bookmarks/types.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 Polymer({ 5 Polymer({
6 is: 'bookmarks-list', 6 is: 'bookmarks-list',
7 7
8 behaviors: [ 8 behaviors: [
9 bookmarks.StoreClient, 9 bookmarks.StoreClient,
10 ], 10 ],
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 /** @return {HTMLElement} */ 55 /** @return {HTMLElement} */
56 getDropTarget: function() { 56 getDropTarget: function() {
57 return this.$.message; 57 return this.$.message;
58 }, 58 },
59 59
60 /** 60 /**
61 * Updates `displayedList_` using splices to be equivalent to `newValue`. This 61 * Updates `displayedList_` using splices to be equivalent to `newValue`. This
62 * allows the iron-list to delete sublists of items which preserves scroll and 62 * allows the iron-list to delete sublists of items which preserves scroll and
63 * focus on incremental update. 63 * focus on incremental update.
64 * @param {Array<string>} newValue 64 * @param {!Array<string>} newValue
65 * @param {Array<string>} oldValue 65 * @param {!Array<string>} oldValue
66 */ 66 */
67 onDisplayedIdsChanged_: function(newValue, oldValue) { 67 onDisplayedIdsChanged_: function(newValue, oldValue) {
68 if (!oldValue) { 68 if (!oldValue) {
Dan Beam 2017/05/24 02:52:42 hmmmm, how can !oldValue ever succeed if oldValue
dpapad 2017/05/24 17:45:42 The problem is that calculateSplices() has two dif
scottchen 2017/05/24 20:36:25 Done.
scottchen 2017/05/24 20:36:25 Acknowledged.
69 this.displayedList_ = this.displayedIds_.map(function(id) { 69 this.displayedList_ = this.displayedIds_.map(function(id) {
70 return {id: id}; 70 return {id: id};
71 }); 71 });
72 } else { 72 } else {
73 var splices = Polymer.ArraySplice.calculateSplices(newValue, oldValue); 73 var splices = Polymer.ArraySplice.calculateSplices(newValue, oldValue);
74 splices.forEach(function(splice) { 74 splices.forEach(function(splice) {
75 // TODO(calamity): Could use notifySplices to improve performance here. 75 // TODO(calamity): Could use notifySplices to improve performance here.
76 var additions = 76 var additions =
77 newValue.slice(splice.index, splice.index + splice.addedCount) 77 newValue.slice(splice.index, splice.index + splice.addedCount)
78 .map(function(id) { 78 .map(function(id) {
(...skipping 15 matching lines...) Expand all
94 /** @private */ 94 /** @private */
95 isEmptyList_: function() { 95 isEmptyList_: function() {
96 return this.displayedList_.length == 0; 96 return this.displayedList_.length == 0;
97 }, 97 },
98 98
99 /** @private */ 99 /** @private */
100 deselectItems_: function() { 100 deselectItems_: function() {
101 this.dispatch(bookmarks.actions.deselectItems()); 101 this.dispatch(bookmarks.actions.deselectItems());
102 }, 102 },
103 }); 103 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/md_bookmarks/types.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698