diff options
author | dubroy@chromium.org <dubroy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-23 07:37:38 +0000 |
---|---|---|
committer | dubroy@chromium.org <dubroy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-23 07:37:38 +0000 |
commit | 8aa8f87defcdf73c74ff61c4b053528b0d3c605c (patch) | |
tree | dc8707721a2c521501341c633405bbaefd1d1d46 | |
parent | 4ec1764c35d9b08114b58e9a40f89a64253f144d (diff) | |
download | chromium_src-8aa8f87defcdf73c74ff61c4b053528b0d3c605c.zip chromium_src-8aa8f87defcdf73c74ff61c4b053528b0d3c605c.tar.gz chromium_src-8aa8f87defcdf73c74ff61c4b053528b0d3c605c.tar.bz2 |
Merge 221512 "History: Prevent search box from disappearing when..."
> History: Prevent search box from disappearing when search term is deleted.
>
> Also removed unnecessary calls to updateNavBar_().
>
> This fix is based on http://crrev.com/219018, which had to be reverted
> because it introduced a regression.
>
> BUG=263870
> TEST=See repro steps in bug.
> R=jhawkins@chromium.org
>
> Review URL: https://codereview.chromium.org/23464026
TBR=dubroy@chromium.org
Review URL: https://codereview.chromium.org/24305004
git-svn-id: svn://svn.chromium.org/chrome/branches/1599/src@224689 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/resources/history/history.js | 14 | ||||
-rw-r--r-- | chrome/browser/resources/history/history_mobile.css | 5 |
2 files changed, 10 insertions, 9 deletions
diff --git a/chrome/browser/resources/history/history.js b/chrome/browser/resources/history/history.js index 1227c99..4ef1b84 100644 --- a/chrome/browser/resources/history/history.js +++ b/chrome/browser/resources/history/history.js @@ -938,6 +938,13 @@ HistoryView.prototype.onModelReady = function(doneLoading) { document.body.classList.remove('has-results'); this.updateNavBar_(); + + if (isMobileVersion()) { + // Hide the search field if it is empty and there are no results. + var hasResults = this.model_.visits_.length > 0; + var isSearch = this.model_.getSearchText().length > 0; + $('search-field').hidden = !(hasResults || isSearch); + } }; /** @@ -1298,7 +1305,6 @@ HistoryView.prototype.displayResults_ = function(doneLoading) { createElementWithClassName('div', 'no-results-message')); noResults.textContent = loadTimeData.getString('noResults'); this.resultDiv_.appendChild(resultsFragment); - this.updateNavBar_(); return; } @@ -1326,7 +1332,6 @@ HistoryView.prototype.displayResults_ = function(doneLoading) { // Add all the days and their visits to the page. this.resultDiv_.appendChild(resultsFragment); } - this.updateNavBar_(); }; /** @@ -1335,9 +1340,10 @@ HistoryView.prototype.displayResults_ = function(doneLoading) { */ HistoryView.prototype.updateNavBar_ = function() { this.updateRangeButtons_(); + + // Managed users have the control bar on top, don't show it on the bottom + // as well. if (!loadTimeData.getBoolean('isManagedProfile')) { - // Managed users have the control bar on top, don't show it on the bottom - // as well. $('newest-button').hidden = this.pageIndex_ == 0; $('newer-button').hidden = this.pageIndex_ == 0; $('older-button').hidden = diff --git a/chrome/browser/resources/history/history_mobile.css b/chrome/browser/resources/history/history_mobile.css index 41268f5..3011289 100644 --- a/chrome/browser/resources/history/history_mobile.css +++ b/chrome/browser/resources/history/history_mobile.css @@ -66,11 +66,6 @@ html[dir='rtl'] #search-field { background-position: right 16px center; } -/* Hide the search field if it is empty (!valid) and there are no results. */ -body:not(.has-results) #search-field:not(:valid) { - display: none; -} - .no-results-message { margin-bottom: 1em; padding-left: 16px; |