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

Unified Diff: chrome/browser/resources/history/history.js

Issue 23464026: History: Prevent search box from disappearing when search term is deleted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/history/history_mobile.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/history/history.js
diff --git a/chrome/browser/resources/history/history.js b/chrome/browser/resources/history/history.js
index 1227c99fe478fdc36b50399cc090c380ed4d447a..4ef1b84955ee177c8c873abfa10142e76ef3d81a 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 =
« no previous file with comments | « no previous file | chrome/browser/resources/history/history_mobile.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698