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

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

Issue 2454303002: [MD History] Add full time hover text to dates in history items. (Closed)
Patch Set: do less, be lazy Created 4 years, 1 month 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 | « chrome/browser/resources/md_history/history_item.html ('k') | 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 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 /** 5 /**
6 * @param {!Element} root 6 * @param {!Element} root
7 * @param {?Element} boundary 7 * @param {?Element} boundary
8 * @param {cr.ui.FocusRow.Delegate} delegate 8 * @param {cr.ui.FocusRow.Delegate} delegate
9 * @constructor 9 * @constructor
10 * @extends {cr.ui.FocusRow} 10 * @extends {cr.ui.FocusRow}
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 * @param {string} historyDate Date of the current result. 293 * @param {string} historyDate Date of the current result.
294 * @param {string} search The search term associated with these results. 294 * @param {string} search The search term associated with these results.
295 * @return {string} The title for this history card. 295 * @return {string} The title for this history card.
296 * @private 296 * @private
297 */ 297 */
298 cardTitle_: function(numberOfItems, historyDate, search) { 298 cardTitle_: function(numberOfItems, historyDate, search) {
299 if (!search) 299 if (!search)
300 return this.item.dateRelativeDay; 300 return this.item.dateRelativeDay;
301 return HistoryItem.searchResultsTitle(numberOfItems, search); 301 return HistoryItem.searchResultsTitle(numberOfItems, search);
302 }, 302 },
303
304 /**
305 * @private
306 */
Dan Beam 2016/10/28 20:43:28 nit: /** @private */
307 addTimeTitle_: function() {
308 var el = this.$['time-accessed'];
309 el.setAttribute('title', new Date(this.item.time).toString());
310 this.unlisten(el, 'mouseover', 'addTimeTitle_');
311 },
303 }); 312 });
304 313
305 /** 314 /**
306 * Check whether the time difference between the given history item and the 315 * Check whether the time difference between the given history item and the
307 * next one is large enough for a spacer to be required. 316 * next one is large enough for a spacer to be required.
308 * @param {Array<HistoryEntry>} visits 317 * @param {Array<HistoryEntry>} visits
309 * @param {number} currentIndex 318 * @param {number} currentIndex
310 * @param {string} searchedTerm 319 * @param {string} searchedTerm
311 * @return {boolean} Whether or not time gap separator is required. 320 * @return {boolean} Whether or not time gap separator is required.
312 */ 321 */
(...skipping 17 matching lines...) Expand all
330 * @return {string} The title for a page of search results. 339 * @return {string} The title for a page of search results.
331 */ 340 */
332 HistoryItem.searchResultsTitle = function(numberOfResults, searchTerm) { 341 HistoryItem.searchResultsTitle = function(numberOfResults, searchTerm) {
333 var resultId = numberOfResults == 1 ? 'searchResult' : 'searchResults'; 342 var resultId = numberOfResults == 1 ? 'searchResult' : 'searchResults';
334 return loadTimeData.getStringF('foundSearchResults', numberOfResults, 343 return loadTimeData.getStringF('foundSearchResults', numberOfResults,
335 loadTimeData.getString(resultId), searchTerm); 344 loadTimeData.getString(resultId), searchTerm);
336 }; 345 };
337 346
338 return { HistoryItem: HistoryItem }; 347 return { HistoryItem: HistoryItem };
339 }); 348 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_history/history_item.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698