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

Unified Diff: chrome/renderer/resources/neterror.js

Issue 601523003: Network error interstitial bug fixes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix blue button flash when page loads Created 6 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 | « chrome/renderer/resources/neterror.html ('k') | chrome/renderer/resources/offline.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/neterror.js
diff --git a/chrome/renderer/resources/neterror.js b/chrome/renderer/resources/neterror.js
index ae6efae94ef231530cd3efbc1c3cf453bc608dc3..ae34582c6a3aa601c0de29281b85702aba903020 100644
--- a/chrome/renderer/resources/neterror.js
+++ b/chrome/renderer/resources/neterror.js
@@ -50,6 +50,11 @@ function updateIconClass(classList, newClass) {
classList.remove(oldClass);
classList['last_icon_class'] = newClass;
+
+ if (newClass == 'icon-offline') {
+ document.body.classList.add('offline');
+ new Runner('.interstitial-wrapper');
+ }
}
// Does a search using |baseSearchUrl| and the text in the search box.
@@ -127,17 +132,19 @@ function setButtonLayout() {
detailsButton.classList.add('singular');
}
- // Hide the details button if there are no details to show.
- if (templateData && templateData.summary && !templateData.summary.msg) {
- document.getElementById('details-button').hidden = true;
- document.getElementById('help-box-outer').style.display = 'block';
+ if (templateData) {
+ // Hide the details button if there are no details to show.
+ if (templateData.summary && !templateData.summary.msg) {
+ detailsButton.hidden = true;
+ document.getElementById('help-box-outer').style.display = 'block';
+ }
+
+ // Show control buttons.
+ if (templateData.reloadButton && templateData.reloadButton.msg ||
+ templateData.staleLoadButton && templateData.staleLoadButton.msg) {
+ controlButtonDiv.hidden = false;
+ }
}
}
-document.addEventListener('DOMContentLoaded', function() {
- setButtonLayout();
- if (document.querySelector('.icon-offline')) {
- document.body.classList.add('offline');
- new Runner('.interstitial-wrapper');
- }
-});
+document.addEventListener('DOMContentLoaded', setButtonLayout);
« no previous file with comments | « chrome/renderer/resources/neterror.html ('k') | chrome/renderer/resources/offline.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698