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

Side by Side Diff: chrome/browser/resources/history/history.js

Issue 1090783002: Focus the history group that was clicked. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | 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 (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 1784 matching lines...) Expand 10 before | Expand all | Expand 10 after
1795 // the height to auto so that it is computed and then set it to the 1795 // the height to auto so that it is computed and then set it to the
1796 // computed value in pixels so the transition works properly. 1796 // computed value in pixels so the transition works properly.
1797 var height = innerResultList.clientHeight; 1797 var height = innerResultList.clientHeight;
1798 innerResultList.style.height = 0; 1798 innerResultList.style.height = 0;
1799 setTimeout(function() { 1799 setTimeout(function() {
1800 innerResultList.style.height = height + 'px'; 1800 innerResultList.style.height = height + 'px';
1801 }, 0); 1801 }, 0);
1802 } 1802 }
1803 1803
1804 entry.classList.toggle('expand'); 1804 entry.classList.toggle('expand');
1805
1806 var row = entry.querySelector('.site-domain-wrapper');
1807 var activeRows =
1808 this.resultDiv_.getElementsByClassName(cr.ui.FocusRow.ACTIVE_CLASS);
1809 for (var i = 0; i < activeRows.length; ++i) {
1810 if (activeRows[i] != row) // Ignore |row| to avoid flicker.
1811 activeRows[i].makeActive(false);
1812 }
1813 row.makeActive(true);
1814
1805 this.updateFocusGrid_(); 1815 this.updateFocusGrid_();
1806 }; 1816 };
1807 1817
1808 /////////////////////////////////////////////////////////////////////////////// 1818 ///////////////////////////////////////////////////////////////////////////////
1809 // State object: 1819 // State object:
1810 /** 1820 /**
1811 * An 'AJAX-history' implementation. 1821 * An 'AJAX-history' implementation.
1812 * @param {HistoryModel} model The model we're representing. 1822 * @param {HistoryModel} model The model we're representing.
1813 * @param {HistoryView} view The view we're representing. 1823 * @param {HistoryView} view The view we're representing.
1814 * @constructor 1824 * @constructor
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
2399 historyView.reload(); 2409 historyView.reload();
2400 } 2410 }
2401 2411
2402 // Add handlers to HTML elements. 2412 // Add handlers to HTML elements.
2403 document.addEventListener('DOMContentLoaded', load); 2413 document.addEventListener('DOMContentLoaded', load);
2404 2414
2405 // This event lets us enable and disable menu items before the menu is shown. 2415 // This event lets us enable and disable menu items before the menu is shown.
2406 document.addEventListener('canExecute', function(e) { 2416 document.addEventListener('canExecute', function(e) {
2407 e.canExecute = true; 2417 e.canExecute = true;
2408 }); 2418 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698