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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 offlineStatusEl.title = offlineStatusText; | 133 offlineStatusEl.title = offlineStatusText; |
134 | 134 |
135 var isOffline = destination.isOffline; | 135 var isOffline = destination.isOffline; |
136 destinationSettingsBoxEl.classList.toggle( | 136 destinationSettingsBoxEl.classList.toggle( |
137 DestinationSettings.Classes_.STALE, isOffline); | 137 DestinationSettings.Classes_.STALE, isOffline); |
138 setIsVisible(locationEl, !isOffline); | 138 setIsVisible(locationEl, !isOffline); |
139 setIsVisible(offlineStatusEl, isOffline); | 139 setIsVisible(offlineStatusEl, isOffline); |
140 } | 140 } |
141 | 141 |
142 setIsVisible( | 142 setIsVisible( |
143 this.getChildElement('.throbber-container'), destination == null); | 143 this.getChildElement('.throbber-container'), |
144 setIsVisible(destinationSettingsBoxEl, destination != null); | 144 this.destinationStore_.isAutoSelectDestinationInProgress); |
| 145 setIsVisible(destinationSettingsBoxEl, !!destination); |
145 }, | 146 }, |
146 | 147 |
147 onSelectedDestinationNameSet_: function() { | 148 onSelectedDestinationNameSet_: function() { |
148 var destinationName = | 149 var destinationName = |
149 this.destinationStore_.selectedDestination.displayName; | 150 this.destinationStore_.selectedDestination.displayName; |
150 var nameEl = this.getElement().getElementsByClassName( | 151 var nameEl = this.getElement().getElementsByClassName( |
151 DestinationSettings.Classes_.THOBBER_NAME)[0]; | 152 DestinationSettings.Classes_.THOBBER_NAME)[0]; |
152 nameEl.textContent = destinationName; | 153 nameEl.textContent = destinationName; |
153 nameEl.title = destinationName; | 154 nameEl.title = destinationName; |
154 } | 155 } |
155 }; | 156 }; |
156 | 157 |
157 // Export | 158 // Export |
158 return { | 159 return { |
159 DestinationSettings: DestinationSettings | 160 DestinationSettings: DestinationSettings |
160 }; | 161 }; |
161 }); | 162 }); |
OLD | NEW |