OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 * FontSettings class | 10 * FontSettings class |
(...skipping 16 matching lines...) Expand all Loading... |
27 * Initialize the page. | 27 * Initialize the page. |
28 */ | 28 */ |
29 initializePage: function() { | 29 initializePage: function() { |
30 OptionsPage.prototype.initializePage.call(this); | 30 OptionsPage.prototype.initializePage.call(this); |
31 | 31 |
32 var standardFontRange = $('standard-font-size'); | 32 var standardFontRange = $('standard-font-size'); |
33 standardFontRange.valueMap = [9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, | 33 standardFontRange.valueMap = [9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, |
34 22, 24, 26, 28, 30, 32, 34, 36, 40, 44, 48, 56, 64, 72]; | 34 22, 24, 26, 28, 30, 32, 34, 36, 40, 44, 48, 56, 64, 72]; |
35 standardFontRange.addEventListener( | 35 standardFontRange.addEventListener( |
36 'change', this.standardRangeChanged_.bind(this, standardFontRange)); | 36 'change', this.standardRangeChanged_.bind(this, standardFontRange)); |
| 37 standardFontRange.addEventListener( |
| 38 'input', this.standardRangeChanged_.bind(this, standardFontRange)); |
37 standardFontRange.customChangeHandler = | 39 standardFontRange.customChangeHandler = |
38 this.standardFontSizeChanged_.bind(standardFontRange); | 40 this.standardFontSizeChanged_.bind(standardFontRange); |
39 | 41 |
40 var minimumFontRange = $('minimum-font-size'); | 42 var minimumFontRange = $('minimum-font-size'); |
41 minimumFontRange.valueMap = [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, | 43 minimumFontRange.valueMap = [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, |
42 18, 20, 22, 24]; | 44 18, 20, 22, 24]; |
43 minimumFontRange.addEventListener( | 45 minimumFontRange.addEventListener( |
44 'change', this.minimumRangeChanged_.bind(this, minimumFontRange)); | 46 'change', this.minimumRangeChanged_.bind(this, minimumFontRange)); |
| 47 minimumFontRange.addEventListener( |
| 48 'input', this.minimumRangeChanged_.bind(this, minimumFontRange)); |
45 minimumFontRange.customChangeHandler = | 49 minimumFontRange.customChangeHandler = |
46 this.minimumFontSizeChanged_.bind(minimumFontRange); | 50 this.minimumFontSizeChanged_.bind(minimumFontRange); |
47 | 51 |
48 var placeholder = loadTimeData.getString('fontSettingsPlaceholder'); | 52 var placeholder = loadTimeData.getString('fontSettingsPlaceholder'); |
49 var elements = [$('standard-font-family'), $('serif-font-family'), | 53 var elements = [$('standard-font-family'), $('serif-font-family'), |
50 $('sans-serif-font-family'), $('fixed-font-family'), | 54 $('sans-serif-font-family'), $('fixed-font-family'), |
51 $('font-encoding')]; | 55 $('font-encoding')]; |
52 elements.forEach(function(el) { | 56 elements.forEach(function(el) { |
53 el.appendChild(new Option(placeholder)); | 57 el.appendChild(new Option(placeholder)); |
54 el.setDisabled('noFontsAvailable', true); | 58 el.setDisabled('noFontsAvailable', true); |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 $('advanced-font-settings-install').hidden = available; | 250 $('advanced-font-settings-install').hidden = available; |
247 $('advanced-font-settings-options').hidden = !available; | 251 $('advanced-font-settings-options').hidden = !available; |
248 }; | 252 }; |
249 | 253 |
250 // Export | 254 // Export |
251 return { | 255 return { |
252 FontSettings: FontSettings | 256 FontSettings: FontSettings |
253 }; | 257 }; |
254 }); | 258 }); |
255 | 259 |
OLD | NEW |