OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <include src="../uber/uber_utils.js"> | 5 <include src="../uber/uber_utils.js"> |
6 <include src="history_focus_manager.js"> | 6 <include src="history_focus_manager.js"> |
7 | 7 |
8 /////////////////////////////////////////////////////////////////////////////// | 8 /////////////////////////////////////////////////////////////////////////////// |
9 // Globals: | 9 // Globals: |
10 /** @const */ var RESULTS_PER_PAGE = 150; | 10 /** @const */ var RESULTS_PER_PAGE = 150; |
(...skipping 1685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1696 entry.visit.setIsLead(false); | 1696 entry.visit.setIsLead(false); |
1697 else | 1697 else |
1698 el.tabIndex = -1; | 1698 el.tabIndex = -1; |
1699 } | 1699 } |
1700 | 1700 |
1701 // If there's no focusable elements, allow the first visit to be focused. | 1701 // If there's no focusable elements, allow the first visit to be focused. |
1702 if (!this.resultDiv_.querySelector('[tabindex="0"]') && | 1702 if (!this.resultDiv_.querySelector('[tabindex="0"]') && |
1703 this.currentVisits_.length > 0) { | 1703 this.currentVisits_.length > 0) { |
1704 var firstVisit = this.currentVisits_[0]; | 1704 var firstVisit = this.currentVisits_[0]; |
1705 firstVisit.setIsLead(true); | 1705 firstVisit.setIsLead(true); |
1706 if (firstVisit.checkBox) firstVisit.checkBox.tabIndex = 0; | 1706 (firstVisit.checkBox || firstVisit.titleLink).tabIndex = 0; |
1707 } | 1707 } |
1708 }; | 1708 }; |
1709 | 1709 |
1710 | 1710 |
1711 /////////////////////////////////////////////////////////////////////////////// | 1711 /////////////////////////////////////////////////////////////////////////////// |
1712 // State object: | 1712 // State object: |
1713 /** | 1713 /** |
1714 * An 'AJAX-history' implementation. | 1714 * An 'AJAX-history' implementation. |
1715 * @param {HistoryModel} model The model we're representing. | 1715 * @param {HistoryModel} model The model we're representing. |
1716 * @param {HistoryView} view The view we're representing. | 1716 * @param {HistoryView} view The view we're representing. |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2290 historyView.reload(); | 2290 historyView.reload(); |
2291 } | 2291 } |
2292 | 2292 |
2293 // Add handlers to HTML elements. | 2293 // Add handlers to HTML elements. |
2294 document.addEventListener('DOMContentLoaded', load); | 2294 document.addEventListener('DOMContentLoaded', load); |
2295 | 2295 |
2296 // This event lets us enable and disable menu items before the menu is shown. | 2296 // This event lets us enable and disable menu items before the menu is shown. |
2297 document.addEventListener('canExecute', function(e) { | 2297 document.addEventListener('canExecute', function(e) { |
2298 e.canExecute = true; | 2298 e.canExecute = true; |
2299 }); | 2299 }); |
OLD | NEW |