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

Unified Diff: chrome/browser/resources/help/help_page.js

Issue 449623003: Integrate About page into Settings for Chrome OS settings in a window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 4 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/browser/resources/help/help.js ('k') | chrome/browser/resources/options/browser_options.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/help/help_page.js
diff --git a/chrome/browser/resources/help/help_page.js b/chrome/browser/resources/help/help_page.js
index 10a1807a93a813abd2386e450a635a8c2ad52c0b..d7cf0b78c51240c1c9fe4ae1524c8650007fcc90 100644
--- a/chrome/browser/resources/help/help_page.js
+++ b/chrome/browser/resources/help/help_page.js
@@ -11,8 +11,9 @@ cr.define('help', function() {
* confusion with generic AboutUI (about:memory, about:sandbox, etc.).
*/
function HelpPage() {
- Page.call(this, 'help', loadTimeData.getString('aboutTitle'),
- 'help-page');
+ var id = loadTimeData.valueExists('aboutOverlayTabTitle') ?
+ 'aboutOverlayTabTitle' : 'aboutTitle';
+ Page.call(this, 'help', loadTimeData.getString(id), 'help-page');
}
cr.addSingletonGetter(HelpPage);
@@ -143,23 +144,40 @@ cr.define('help', function() {
chrome.send('onPageLoaded');
},
+ /** @override */
+ didClosePage: function() {
+ this.setMoreInfoVisible_(false);
+ },
+
/**
- * Toggles the visible state of the 'More Info' section.
+ * Sets the visible state of the 'More Info' section.
+ * @param {boolean} visible Whether the section should be visible.
* @private
*/
- toggleMoreInfo_: function() {
+ setMoreInfoVisible_: function(visible) {
var moreInfo = $('more-info-container');
- var visible = moreInfo.className == 'visible';
- moreInfo.className = visible ? '' : 'visible';
- moreInfo.style.height = visible ? '' : moreInfo.scrollHeight + 'px';
+ if (visible == moreInfo.classList.contains('visible'))
+ return;
+
+ moreInfo.classList.toggle('visible', visible);
+ moreInfo.style.height = visible ? moreInfo.scrollHeight + 'px' : '';
moreInfo.addEventListener('webkitTransitionEnd', function(event) {
$('more-info-expander').textContent = visible ?
- loadTimeData.getString('showMoreInfo') :
- loadTimeData.getString('hideMoreInfo');
+ loadTimeData.getString('hideMoreInfo') :
+ loadTimeData.getString('showMoreInfo');
});
},
/**
+ * Toggles the visible state of the 'More Info' section.
+ * @private
+ */
+ toggleMoreInfo_: function() {
+ var moreInfo = $('more-info-container');
+ this.setMoreInfoVisible_(!moreInfo.classList.contains('visible'));
+ },
+
+ /**
* Assigns |method| to the onclick property of |el| if |el| exists.
* @param {HTMLElement} el The element on which to set the click handler.
* @param {function} method The click handler.
« no previous file with comments | « chrome/browser/resources/help/help.js ('k') | chrome/browser/resources/options/browser_options.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698