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('print_preview', function() { | 5 cr.define('print_preview', function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 // TODO(rltoscano): This class needs a throbber while loading the destination | 8 // TODO(rltoscano): This class needs a throbber while loading the destination |
9 // or another solution is persist the settings of the printer so that next | 9 // or another solution is persist the settings of the printer so that next |
10 // load is fast. | 10 // load is fast. |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 offlineStatusEl.title = offlineStatusText; | 143 offlineStatusEl.title = offlineStatusText; |
144 | 144 |
145 var isOffline = destination.isOffline; | 145 var isOffline = destination.isOffline; |
146 destinationSettingsBoxEl.classList.toggle( | 146 destinationSettingsBoxEl.classList.toggle( |
147 DestinationSettings.Classes_.STALE, isOffline); | 147 DestinationSettings.Classes_.STALE, isOffline); |
148 setIsVisible(locationEl, !isOffline); | 148 setIsVisible(locationEl, !isOffline); |
149 setIsVisible(offlineStatusEl, isOffline); | 149 setIsVisible(offlineStatusEl, isOffline); |
150 } | 150 } |
151 | 151 |
152 setIsVisible( | 152 setIsVisible( |
153 assert(this.getChildElement('.throbber-container')), | 153 this.getChildElement('.throbber-container'), |
154 this.destinationStore_.isAutoSelectDestinationInProgress); | 154 this.destinationStore_.isAutoSelectDestinationInProgress); |
155 setIsVisible(assert(destinationSettingsBoxEl), !!destination); | 155 setIsVisible(destinationSettingsBoxEl, !!destination); |
156 }, | 156 }, |
157 | 157 |
158 onSelectedDestinationNameSet_: function() { | 158 onSelectedDestinationNameSet_: function() { |
159 var destinationName = | 159 var destinationName = |
160 this.destinationStore_.selectedDestination.displayName; | 160 this.destinationStore_.selectedDestination.displayName; |
161 var nameEl = this.getElement().getElementsByClassName( | 161 var nameEl = this.getElement().getElementsByClassName( |
162 DestinationSettings.Classes_.THOBBER_NAME)[0]; | 162 DestinationSettings.Classes_.THOBBER_NAME)[0]; |
163 nameEl.textContent = destinationName; | 163 nameEl.textContent = destinationName; |
164 nameEl.title = destinationName; | 164 nameEl.title = destinationName; |
165 } | 165 } |
166 }; | 166 }; |
167 | 167 |
168 // Export | 168 // Export |
169 return { | 169 return { |
170 DestinationSettings: DestinationSettings | 170 DestinationSettings: DestinationSettings |
171 }; | 171 }; |
172 }); | 172 }); |
OLD | NEW |