| 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 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 }; | 989 }; |
| 990 | 990 |
| 991 // HistoryView, private: ------------------------------------------------------ | 991 // HistoryView, private: ------------------------------------------------------ |
| 992 | 992 |
| 993 /** | 993 /** |
| 994 * Clear the results in the view. Since we add results piecemeal, we need | 994 * Clear the results in the view. Since we add results piecemeal, we need |
| 995 * to clear them out when we switch to a new page or reload. | 995 * to clear them out when we switch to a new page or reload. |
| 996 * @private | 996 * @private |
| 997 */ | 997 */ |
| 998 HistoryView.prototype.clear_ = function() { | 998 HistoryView.prototype.clear_ = function() { |
| 999 if ($('alertOverlay').classList.contains('showing')) | 999 var alertOverlay = $('alertOverlay'); |
| 1000 if (alertOverlay && alertOverlay.classList.contains('showing')) |
| 1000 hideConfirmationOverlay(); | 1001 hideConfirmationOverlay(); |
| 1001 | 1002 |
| 1002 this.resultDiv_.textContent = ''; | 1003 this.resultDiv_.textContent = ''; |
| 1003 | 1004 |
| 1004 this.currentVisits_.forEach(function(visit) { | 1005 this.currentVisits_.forEach(function(visit) { |
| 1005 visit.isRendered = false; | 1006 visit.isRendered = false; |
| 1006 }); | 1007 }); |
| 1007 this.currentVisits_ = []; | 1008 this.currentVisits_ = []; |
| 1008 | 1009 |
| 1009 document.body.classList.remove('has-results'); | 1010 document.body.classList.remove('has-results'); |
| (...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2023 historyView.reload(); | 2024 historyView.reload(); |
| 2024 } | 2025 } |
| 2025 | 2026 |
| 2026 // Add handlers to HTML elements. | 2027 // Add handlers to HTML elements. |
| 2027 document.addEventListener('DOMContentLoaded', load); | 2028 document.addEventListener('DOMContentLoaded', load); |
| 2028 | 2029 |
| 2029 // This event lets us enable and disable menu items before the menu is shown. | 2030 // This event lets us enable and disable menu items before the menu is shown. |
| 2030 document.addEventListener('canExecute', function(e) { | 2031 document.addEventListener('canExecute', function(e) { |
| 2031 e.canExecute = true; | 2032 e.canExecute = true; |
| 2032 }); | 2033 }); |
| OLD | NEW |