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

Side by Side Diff: chrome/browser/resources/md_history/history_item.js

Issue 1880783002: MD History: Use computed functions for card borders and time gaps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comment Created 4 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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: 'history-item', 6 is: 'history-item',
7 7
8 properties: { 8 properties: {
9 // Underlying HistoryEntry data for this item. Contains read-only fields 9 // Underlying HistoryEntry data for this item. Contains read-only fields
10 // from the history backend, as well as fields computed by history-list. 10 // from the history backend, as well as fields computed by history-list.
(...skipping 26 matching lines...) Expand all
37 value: false, 37 value: false,
38 reflectToAttribute: true 38 reflectToAttribute: true
39 }, 39 },
40 40
41 isCardEnd: { 41 isCardEnd: {
42 type: Boolean, 42 type: Boolean,
43 value: false, 43 value: false,
44 reflectToAttribute: true 44 reflectToAttribute: true
45 }, 45 },
46 46
47 hasTimeGap: {
48 type: Boolean,
49 value: false,
50 },
51
47 numberOfItems: { 52 numberOfItems: {
48 type: Number, 53 type: Number,
49 value: 0 54 value: 0
50 } 55 }
51 }, 56 },
52 57
53 observers: [ 58 observers: [
54 'setSearchedTextToBold_(item.title, searchTerm)' 59 'setSearchedTextToBold_(item.title, searchTerm)'
55 ], 60 ],
56 61
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 */ 142 */
138 cardTitle_: function(numberOfItems, historyDate, search) { 143 cardTitle_: function(numberOfItems, historyDate, search) {
139 if (!search) 144 if (!search)
140 return this.item.dateRelativeDay; 145 return this.item.dateRelativeDay;
141 146
142 var resultId = numberOfItems == 1 ? 'searchResult' : 'searchResults'; 147 var resultId = numberOfItems == 1 ? 'searchResult' : 'searchResults';
143 return loadTimeData.getStringF('foundSearchResults', numberOfItems, 148 return loadTimeData.getStringF('foundSearchResults', numberOfItems,
144 loadTimeData.getString(resultId), search); 149 loadTimeData.getString(resultId), search);
145 } 150 }
146 }); 151 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698