OLD | NEW |
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 cr.define('options', function() { | 5 cr.define('options', function() { |
6 | 6 |
7 var OptionsPage = options.OptionsPage; | 7 var OptionsPage = options.OptionsPage; |
8 | 8 |
9 // | 9 // |
10 // AdvancedOptions class | 10 // AdvancedOptions class |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 168 |
169 AdvancedOptions.SetMetricsReportingSettingVisibility = function(visible) { | 169 AdvancedOptions.SetMetricsReportingSettingVisibility = function(visible) { |
170 if (visible) { | 170 if (visible) { |
171 $('metricsReportingSetting').style.display = 'block'; | 171 $('metricsReportingSetting').style.display = 'block'; |
172 } else { | 172 } else { |
173 $('metricsReportingSetting').style.display = 'none'; | 173 $('metricsReportingSetting').style.display = 'none'; |
174 } | 174 } |
175 } | 175 } |
176 | 176 |
177 // Set the font size selected item. | 177 // Set the font size selected item. |
178 AdvancedOptions.SetFontSize = function(fixed_font_size_value, | 178 AdvancedOptions.SetFontSize = function(font_size_value) { |
179 font_size_value) { | |
180 var selectCtl = $('defaultFontSize'); | 179 var selectCtl = $('defaultFontSize'); |
181 if (fixed_font_size_value == font_size_value) { | 180 for (var i = 0; i < selectCtl.options.length; i++) { |
182 for (var i = 0; i < selectCtl.options.length; i++) { | 181 if (selectCtl.options[i].value == font_size_value) { |
183 if (selectCtl.options[i].value == font_size_value) { | 182 selectCtl.selectedIndex = i; |
184 selectCtl.selectedIndex = i; | 183 if ($('Custom')) |
185 if ($('Custom')) | 184 selectCtl.remove($('Custom').index); |
186 selectCtl.remove($('Custom').index); | 185 return; |
187 return; | |
188 } | |
189 } | 186 } |
190 } | 187 } |
191 | 188 |
192 // Add/Select Custom Option in the font size label list. | 189 // Add/Select Custom Option in the font size label list. |
193 if (!$('Custom')) { | 190 if (!$('Custom')) { |
194 var option = new Option(localStrings.getString('fontSizeLabelCustom'), | 191 var option = new Option(localStrings.getString('fontSizeLabelCustom'), |
195 -1, false, true); | 192 -1, false, true); |
196 option.setAttribute("id", "Custom"); | 193 option.setAttribute("id", "Custom"); |
197 selectCtl.add(option); | 194 selectCtl.add(option); |
198 } | 195 } |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 if (proxySectionElm) | 292 if (proxySectionElm) |
296 proxySectionElm.parentNode.removeChild(proxySectionElm); | 293 proxySectionElm.parentNode.removeChild(proxySectionElm); |
297 }; | 294 }; |
298 | 295 |
299 // Export | 296 // Export |
300 return { | 297 return { |
301 AdvancedOptions: AdvancedOptions | 298 AdvancedOptions: AdvancedOptions |
302 }; | 299 }; |
303 | 300 |
304 }); | 301 }); |
OLD | NEW |