| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 function toggleHelpBox() { | 5 function toggleHelpBox() { |
| 6 var helpBoxOuter = document.getElementById('help-box-outer'); | 6 var helpBoxOuter = document.getElementById('help-box-outer'); |
| 7 helpBoxOuter.classList.toggle('hidden'); | 7 helpBoxOuter.classList.toggle('hidden'); |
| 8 var detailsButton = document.getElementById('details-button'); | 8 var detailsButton = document.getElementById('details-button'); |
| 9 if (helpBoxOuter.classList.contains('hidden')) | 9 if (helpBoxOuter.classList.contains('hidden')) |
| 10 detailsButton.innerText = detailsButton.detailsText; | 10 detailsButton.innerText = detailsButton.detailsText; |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 } | 128 } |
| 129 | 129 |
| 130 if (reloadButton.style.display == 'none' && | 130 if (reloadButton.style.display == 'none' && |
| 131 staleLoadButton.style.display == 'none') { | 131 staleLoadButton.style.display == 'none') { |
| 132 detailsButton.classList.add('singular'); | 132 detailsButton.classList.add('singular'); |
| 133 } | 133 } |
| 134 | 134 |
| 135 if (templateData) { | 135 if (templateData) { |
| 136 // Hide the details button if there are no details to show. | 136 // Hide the details button if there are no details to show. |
| 137 if (templateData.summary && !templateData.summary.msg) { | 137 if (templateData.summary && !templateData.summary.msg) { |
| 138 detailsButton.hidden = true; | 138 detailsButton.style.display = 'none'; |
| 139 document.getElementById('help-box-outer').style.display = 'block'; | 139 document.getElementById('help-box-outer').style.display = 'block'; |
| 140 } | 140 } |
| 141 | 141 |
| 142 // Show control buttons. | 142 // Show control buttons. |
| 143 if (templateData.reloadButton && templateData.reloadButton.msg || | 143 if (templateData.reloadButton && templateData.reloadButton.msg || |
| 144 templateData.staleLoadButton && templateData.staleLoadButton.msg) { | 144 templateData.staleLoadButton && templateData.staleLoadButton.msg) { |
| 145 controlButtonDiv.hidden = false; | 145 controlButtonDiv.hidden = false; |
| 146 } | 146 } |
| 147 } | 147 } |
| 148 } | 148 } |
| 149 | 149 |
| 150 document.addEventListener('DOMContentLoaded', setButtonLayout); | 150 document.addEventListener('DOMContentLoaded', setButtonLayout); |
| OLD | NEW |