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 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1285 var siteDomainRow = siteDomainWrapper.appendChild( | 1285 var siteDomainRow = siteDomainWrapper.appendChild( |
1286 createElementWithClassName('div', 'site-domain-row')); | 1286 createElementWithClassName('div', 'site-domain-row')); |
1287 | 1287 |
1288 if (this.model_.editingEntriesAllowed) { | 1288 if (this.model_.editingEntriesAllowed) { |
1289 var siteDomainCheckbox = | 1289 var siteDomainCheckbox = |
1290 createElementWithClassName('input', 'domain-checkbox'); | 1290 createElementWithClassName('input', 'domain-checkbox'); |
1291 | 1291 |
1292 siteDomainCheckbox.type = 'checkbox'; | 1292 siteDomainCheckbox.type = 'checkbox'; |
1293 siteDomainCheckbox.addEventListener('click', domainCheckboxClicked); | 1293 siteDomainCheckbox.addEventListener('click', domainCheckboxClicked); |
1294 siteDomainCheckbox.domain_ = domain; | 1294 siteDomainCheckbox.domain_ = domain; |
1295 siteDomainCheckbox.setAttribute('aria-label', domain); | |
1295 siteDomainRow.appendChild(siteDomainCheckbox); | 1296 siteDomainRow.appendChild(siteDomainCheckbox); |
1296 } | 1297 } |
1297 | 1298 |
1298 var siteArrow = siteDomainRow.appendChild( | 1299 var siteArrow = siteDomainRow.appendChild( |
1299 createElementWithClassName('div', 'site-domain-arrow')); | 1300 createElementWithClassName('div', 'site-domain-arrow')); |
1300 var siteDomain = siteDomainRow.appendChild( | 1301 var siteDomain = siteDomainRow.appendChild( |
1301 createElementWithClassName('div', 'site-domain')); | 1302 createElementWithClassName('div', 'site-domain')); |
1302 var siteDomainLink = siteDomain.appendChild( | 1303 var siteDomainLink = siteDomain.appendChild( |
1303 createElementWithClassName('button', 'link-button')); | 1304 createElementWithClassName('button', 'link-button')); |
1304 siteDomainLink.addEventListener('click', function(e) { e.preventDefault(); }); | 1305 siteDomainLink.addEventListener('click', function(e) { e.preventDefault(); }); |
(...skipping 14 matching lines...) Expand all Loading... | |
1319 siteDomainRow.appendChild( | 1320 siteDomainRow.appendChild( |
1320 getFilteringStatusDOM(domainVisits[0].hostFilteringBehavior)); | 1321 getFilteringStatusDOM(domainVisits[0].hostFilteringBehavior)); |
1321 } | 1322 } |
1322 | 1323 |
1323 siteResults.appendChild(siteDomainWrapper); | 1324 siteResults.appendChild(siteDomainWrapper); |
1324 var resultsList = siteResults.appendChild( | 1325 var resultsList = siteResults.appendChild( |
1325 createElementWithClassName('ol', 'site-results')); | 1326 createElementWithClassName('ol', 'site-results')); |
1326 resultsList.classList.add('grouped'); | 1327 resultsList.classList.add('grouped'); |
1327 | 1328 |
1328 // Collapse until it gets toggled. | 1329 // Collapse until it gets toggled. |
1329 resultsList.style.height = 0; | 1330 resultsList.style.height = 0; |
aboxhall
2014/08/28 15:21:41
Any reason not to just set this to display: none?
hcarmona
2014/09/03 20:49:34
When I changed this to display: none, the collapse
| |
1331 resultsList.setAttribute('aria-hidden', 'true'); | |
1330 | 1332 |
1331 // Add the results for each of the domain. | 1333 // Add the results for each of the domain. |
1332 var isMonthGroupedResult = this.getRangeInDays() == HistoryModel.Range.MONTH; | 1334 var isMonthGroupedResult = this.getRangeInDays() == HistoryModel.Range.MONTH; |
1333 for (var j = 0, visit; visit = domainVisits[j]; j++) { | 1335 for (var j = 0, visit; visit = domainVisits[j]; j++) { |
1334 resultsList.appendChild(visit.getResultDOM({ | 1336 resultsList.appendChild(visit.getResultDOM({ |
1335 focusless: true, | 1337 focusless: true, |
1336 useMonthDate: isMonthGroupedResult, | 1338 useMonthDate: isMonthGroupedResult, |
1337 })); | 1339 })); |
1338 this.setVisitRendered_(visit); | 1340 this.setVisitRendered_(visit); |
1339 } | 1341 } |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1674 * @param {Event} e The event with element |e.target| which was clicked on. | 1676 * @param {Event} e The event with element |e.target| which was clicked on. |
1675 * @private | 1677 * @private |
1676 */ | 1678 */ |
1677 HistoryView.prototype.toggleGroupedVisits_ = function(e) { | 1679 HistoryView.prototype.toggleGroupedVisits_ = function(e) { |
1678 var entry = findAncestorByClass(/** @type {Element} */(e.target), | 1680 var entry = findAncestorByClass(/** @type {Element} */(e.target), |
1679 'site-entry'); | 1681 'site-entry'); |
1680 var innerResultList = entry.querySelector('.site-results'); | 1682 var innerResultList = entry.querySelector('.site-results'); |
1681 | 1683 |
1682 if (entry.classList.contains('expand')) { | 1684 if (entry.classList.contains('expand')) { |
1683 innerResultList.style.height = 0; | 1685 innerResultList.style.height = 0; |
1686 innerResultList.setAttribute('aria-hidden', 'true'); | |
1684 } else { | 1687 } else { |
1688 innerResultList.setAttribute('aria-hidden', 'false'); | |
1685 innerResultList.style.height = 'auto'; | 1689 innerResultList.style.height = 'auto'; |
1686 // -webkit-transition does not work on height:auto elements so first set | 1690 // -webkit-transition does not work on height:auto elements so first set |
1687 // the height to auto so that it is computed and then set it to the | 1691 // the height to auto so that it is computed and then set it to the |
1688 // computed value in pixels so the transition works properly. | 1692 // computed value in pixels so the transition works properly. |
1689 var height = innerResultList.clientHeight; | 1693 var height = innerResultList.clientHeight; |
1690 innerResultList.style.height = 0; | 1694 innerResultList.style.height = 0; |
1691 setTimeout(function() { | 1695 setTimeout(function() { |
1692 innerResultList.style.height = height + 'px'; | 1696 innerResultList.style.height = height + 'px'; |
1693 }, 0); | 1697 }, 0); |
1694 } | 1698 } |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2253 historyView.reload(); | 2257 historyView.reload(); |
2254 } | 2258 } |
2255 | 2259 |
2256 // Add handlers to HTML elements. | 2260 // Add handlers to HTML elements. |
2257 document.addEventListener('DOMContentLoaded', load); | 2261 document.addEventListener('DOMContentLoaded', load); |
2258 | 2262 |
2259 // This event lets us enable and disable menu items before the menu is shown. | 2263 // This event lets us enable and disable menu items before the menu is shown. |
2260 document.addEventListener('canExecute', function(e) { | 2264 document.addEventListener('canExecute', function(e) { |
2261 e.canExecute = true; | 2265 e.canExecute = true; |
2262 }); | 2266 }); |
OLD | NEW |