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('help', function() { | 5 cr.define('help', function() { |
6 var Page = cr.ui.pageManager.Page; | 6 var Page = cr.ui.pageManager.Page; |
7 var PageManager = cr.ui.pageManager.PageManager; | 7 var PageManager = cr.ui.pageManager.PageManager; |
8 | 8 |
9 /** | 9 /** |
10 * Encapsulated handling of the About page. Called 'help' internally to avoid | 10 * Encapsulated handling of the About page. Called 'help' internally to avoid |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 * @param {boolean} visible Whether the section should be visible. | 219 * @param {boolean} visible Whether the section should be visible. |
220 * @private | 220 * @private |
221 */ | 221 */ |
222 setMoreInfoVisible_: function(visible) { | 222 setMoreInfoVisible_: function(visible) { |
223 var moreInfo = $('more-info-container'); | 223 var moreInfo = $('more-info-container'); |
224 if (!moreInfo || visible == moreInfo.classList.contains('visible')) | 224 if (!moreInfo || visible == moreInfo.classList.contains('visible')) |
225 return; | 225 return; |
226 | 226 |
227 moreInfo.classList.toggle('visible', visible); | 227 moreInfo.classList.toggle('visible', visible); |
228 moreInfo.style.height = visible ? moreInfo.scrollHeight + 'px' : ''; | 228 moreInfo.style.height = visible ? moreInfo.scrollHeight + 'px' : ''; |
229 moreInfo.addEventListener('webkitTransitionEnd', function(event) { | 229 moreInfo.addEventListener('transitionend', function(event) { |
230 $('more-info-expander').textContent = visible ? | 230 $('more-info-expander').textContent = visible ? |
231 loadTimeData.getString('hideMoreInfo') : | 231 loadTimeData.getString('hideMoreInfo') : |
232 loadTimeData.getString('showMoreInfo'); | 232 loadTimeData.getString('showMoreInfo'); |
233 }); | 233 }); |
234 }, | 234 }, |
235 | 235 |
236 /** | 236 /** |
237 * Toggles the visible state of the 'More Info' section. | 237 * Toggles the visible state of the 'More Info' section. |
238 * @private | 238 * @private |
239 */ | 239 */ |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 } | 314 } |
315 | 315 |
316 if (status == 'checking') | 316 if (status == 'checking') |
317 this.haveNeverCheckedForUpdates_ = false; | 317 this.haveNeverCheckedForUpdates_ = false; |
318 this.message_ = message; | 318 this.message_ = message; |
319 | 319 |
320 this.updateUI_(); | 320 this.updateUI_(); |
321 }, | 321 }, |
322 | 322 |
323 /** | 323 /** |
324 * @param {string} eolStatus: The EndofLife status of the device. | 324 * @param {string} eolStatus The EndofLife status of the device. |
325 * @param {string} eolMessage: The EndofLife message to display. | 325 * @param {string} eolMessage The EndofLife message to display. |
326 * @private | 326 * @private |
327 */ | 327 */ |
328 updateEolMessage_: function(eolStatus, eolMessage) { | 328 updateEolMessage_: function(eolStatus, eolMessage) { |
329 this.eolStatus_ = eolStatus; | 329 this.eolStatus_ = eolStatus; |
330 this.eolMessage_ = eolMessage; | 330 this.eolMessage_ = eolMessage; |
331 | 331 |
332 this.updateUI_(); | 332 this.updateUI_(); |
333 }, | 333 }, |
334 | 334 |
335 /** | 335 /** |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 HelpPage.updateEolMessage = function(eolStatus, eolMessage) { | 776 HelpPage.updateEolMessage = function(eolStatus, eolMessage) { |
777 assert(cr.isChromeOS); | 777 assert(cr.isChromeOS); |
778 HelpPage.getInstance().updateEolMessage_(eolStatus, eolMessage); | 778 HelpPage.getInstance().updateEolMessage_(eolStatus, eolMessage); |
779 }; | 779 }; |
780 | 780 |
781 // Export | 781 // Export |
782 return { | 782 return { |
783 HelpPage: HelpPage | 783 HelpPage: HelpPage |
784 }; | 784 }; |
785 }); | 785 }); |
OLD | NEW |