OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 ///////////////////////////////////////////////////////////////////////////// | 7 ///////////////////////////////////////////////////////////////////////////// |
8 // MinimumFontSizeSelect class: | 8 // MinimumFontSizeSelect class: |
9 | 9 |
10 // Define a constructor that uses a select element as its underlying element. | 10 // Define a constructor that uses a select element as its underlying element. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 self.options[self.selectedIndex].value, ''); | 51 self.options[self.selectedIndex].value, ''); |
52 } else { | 52 } else { |
53 Preferences.clearPref( | 53 Preferences.clearPref( |
54 'webkit.webprefs.minimum_font_size', | 54 'webkit.webprefs.minimum_font_size', |
55 'Options_ChangeMinimumFontSize'); | 55 'Options_ChangeMinimumFontSize'); |
56 Preferences.clearPref( | 56 Preferences.clearPref( |
57 'webkit.webprefs.minimum_logical_font_size', ''); | 57 'webkit.webprefs.minimum_logical_font_size', ''); |
58 } | 58 } |
59 }); | 59 }); |
60 }, | 60 }, |
61 | |
62 /** | |
63 * Sets up options in select element. | |
64 * @param {Array} options List of option and their display text. | |
65 * Each element in the array is an array of length 2 which contains options | |
66 * value in the first element and display text in the second element. | |
67 * | |
68 * TODO(zelidrag): move this to that i18n template classes. | |
69 */ | |
70 initializeValues: function(options) { | |
71 options.forEach(function(values) { | |
72 this.appendChild(new Option(values[1], values[0])); | |
73 }, this); | |
74 } | |
75 }; | 61 }; |
76 | 62 |
77 // Export | 63 // Export |
78 return { | 64 return { |
79 MinimumFontSizeSelect: MinimumFontSizeSelect | 65 MinimumFontSizeSelect: MinimumFontSizeSelect |
80 }; | 66 }; |
81 | 67 |
82 }); | 68 }); |
83 | 69 |
OLD | NEW |