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

Unified Diff: chrome/browser/resources/options/language_options.js

Issue 7146009: Options: Hide the language UI elements when the list is empty. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/language_options.js
diff --git a/chrome/browser/resources/options/language_options.js b/chrome/browser/resources/options/language_options.js
index be45bd58f54a775d332c1084688f46887eb3cd59..6d786a6fa82222a26005de54e1d16dfd8232c648 100644
--- a/chrome/browser/resources/options/language_options.js
+++ b/chrome/browser/resources/options/language_options.js
@@ -305,7 +305,13 @@ cr.define('options', function() {
languageDisplayName += ' - ' + languageNativeDisplayName;
}
// Update the currently selected language name.
- $('language-options-language-name').textContent = languageDisplayName;
+ var languageName = $('language-options-language-name');
+ if (languageDisplayName) {
+ languageName.hidden = false;
+ languageName.textContent = languageDisplayName;
+ } else {
+ languageName.hidden = true;
+ }
},
/**
@@ -364,6 +370,7 @@ cr.define('options', function() {
* @private
*/
updateSpellCheckLanguageButton_: function(languageCode) {
+ var display = 'block';
var spellCheckLanguageButton = $(
'language-options-spell-check-language-button');
// Check if the language code matches the current spell check language.
@@ -386,6 +393,8 @@ cr.define('options', function() {
// Add an event listner to the click event.
spellCheckLanguageButton.addEventListener('click',
this.handleSpellCheckLanguageButtonClick_.bind(this));
+ } else if (!languageCode) {
+ display = 'none';
} else {
// If the language is not supported as spell check language, the
// button just says that this language cannot be used for spell
@@ -395,7 +404,7 @@ cr.define('options', function() {
spellCheckLanguageButton.className = 'text-button';
spellCheckLanguageButton.onclick = undefined;
}
- spellCheckLanguageButton.style.display = 'block';
+ spellCheckLanguageButton.style.display = display;
$('language-options-ui-notification-bar').style.display = 'none';
},
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698