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

Side by Side Diff: chrome/browser/resources/options/language_add_language_overlay.js

Issue 8417029: Make settings page more touch friendly (font-size, checkbox, radio, adding language page). (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Remove unnecessary double quote. Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 /////////////////////////////////////////////////////////////////////////////// 5 ///////////////////////////////////////////////////////////////////////////////
6 // AddLanguageOverlay class: 6 // AddLanguageOverlay class:
7 7
8 cr.define('options', function() { 8 cr.define('options', function() {
9 const OptionsPage = options.OptionsPage; 9 const OptionsPage = options.OptionsPage;
10 10
(...skipping 29 matching lines...) Expand all
40 // Create the language list with which users can add a language. 40 // Create the language list with which users can add a language.
41 var addLanguageList = $('add-language-overlay-language-list'); 41 var addLanguageList = $('add-language-overlay-language-list');
42 var languageListData = templateData.languageList; 42 var languageListData = templateData.languageList;
43 for (var i = 0; i < languageListData.length; i++) { 43 for (var i = 0; i < languageListData.length; i++) {
44 var language = languageListData[i]; 44 var language = languageListData[i];
45 var displayText = language.displayName; 45 var displayText = language.displayName;
46 // If the native name is different, add it. 46 // If the native name is different, add it.
47 if (language.displayName != language.nativeDisplayName) { 47 if (language.displayName != language.nativeDisplayName) {
48 displayText += ' - ' + language.nativeDisplayName; 48 displayText += ' - ' + language.nativeDisplayName;
49 } 49 }
50 if (cr.isChromeOS) { 50
51 if (cr.isChromeOS && !cr.isTouch) {
51 var button = document.createElement('button'); 52 var button = document.createElement('button');
52 button.className = 'link-button'; 53 button.className = 'link-button';
53 button.textContent = displayText; 54 button.textContent = displayText;
54 button.languageCode = language.code; 55 button.languageCode = language.code;
55 var li = document.createElement('li'); 56 var li = document.createElement('li');
56 li.languageCode = language.code; 57 li.languageCode = language.code;
57 li.appendChild(button); 58 li.appendChild(button);
58 addLanguageList.appendChild(li); 59 addLanguageList.appendChild(li);
59 } else { 60 } else {
60 var option = document.createElement('option'); 61 var option = document.createElement('option');
61 option.value = language.code; 62 option.value = language.code;
62 option.textContent = displayText; 63 option.textContent = displayText;
63 addLanguageList.appendChild(option); 64 addLanguageList.appendChild(option);
64 } 65 }
65 } 66 }
66 }, 67 },
67 }; 68 };
68 69
69 return { 70 return {
70 AddLanguageOverlay: AddLanguageOverlay 71 AddLanguageOverlay: AddLanguageOverlay
71 }; 72 };
72 }); 73 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698