OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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('print_preview', function() { | 5 cr.define('print_preview', function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 /** | 8 /** |
9 * Toggles visibility of the specified printing options sections. | 9 * Toggles visibility of the specified printing options sections. |
10 * @param {!print_preview.DestinationStore} destinationStore To listen for | 10 * @param {!print_preview.DestinationStore} destinationStore To listen for |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 * @private | 108 * @private |
109 */ | 109 */ |
110 updateState_: function(noAnimation) { | 110 updateState_: function(noAnimation) { |
111 if (!this.firstDestinationReady_) { | 111 if (!this.firstDestinationReady_) { |
112 fadeOutElement(this.getElement(), noAnimation); | 112 fadeOutElement(this.getElement(), noAnimation); |
113 return; | 113 return; |
114 } | 114 } |
115 | 115 |
116 var all = this.settingsToShow_ == MoreSettings.SettingsToShow.ALL; | 116 var all = this.settingsToShow_ == MoreSettings.SettingsToShow.ALL; |
117 this.getChildElement('.more-settings-label').textContent = | 117 this.getChildElement('.more-settings-label').textContent = |
118 localStrings.getString(all ? 'lessOptionsLabel' : 'moreOptionsLabel'); | 118 loadTimeData.getString(all ? 'lessOptionsLabel' : 'moreOptionsLabel'); |
119 var iconEl = this.getChildElement('.more-settings-icon'); | 119 var iconEl = this.getChildElement('.more-settings-icon'); |
120 iconEl.classList.toggle('more-settings-icon-plus', !all); | 120 iconEl.classList.toggle('more-settings-icon-plus', !all); |
121 iconEl.classList.toggle('more-settings-icon-minus', all); | 121 iconEl.classList.toggle('more-settings-icon-minus', all); |
122 | 122 |
123 var availableSections = this.settingsSections_.reduce( | 123 var availableSections = this.settingsSections_.reduce( |
124 function(count, section) { | 124 function(count, section) { |
125 return count + (section.isAvailable() ? 1 : 0); | 125 return count + (section.isAvailable() ? 1 : 0); |
126 }, 0); | 126 }, 0); |
127 | 127 |
128 // Magic 6 is chosen as the number of sections when it still feels like | 128 // Magic 6 is chosen as the number of sections when it still feels like |
(...skipping 17 matching lines...) Expand all Loading... |
146 section.setCollapseContent(collapseContent, noAnimation); | 146 section.setCollapseContent(collapseContent, noAnimation); |
147 }); | 147 }); |
148 } | 148 } |
149 }; | 149 }; |
150 | 150 |
151 // Export | 151 // Export |
152 return { | 152 return { |
153 MoreSettings: MoreSettings | 153 MoreSettings: MoreSettings |
154 }; | 154 }; |
155 }); | 155 }); |
OLD | NEW |