| 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 /** | 5 /** |
| 6 * @fileoverview Login UI header bar implementation. | 6 * @fileoverview Login UI header bar implementation. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 cr.define('login', function() { | 9 cr.define('login', function() { |
| 10 /** | 10 /** |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 }, | 333 }, |
| 334 | 334 |
| 335 /** | 335 /** |
| 336 * Animates Header bar to hide from the screen. | 336 * Animates Header bar to hide from the screen. |
| 337 * | 337 * |
| 338 * @param {function()} callback will be called once animation is finished. | 338 * @param {function()} callback will be called once animation is finished. |
| 339 */ | 339 */ |
| 340 animateOut: function(callback) { | 340 animateOut: function(callback) { |
| 341 var launcher = this; | 341 var launcher = this; |
| 342 launcher.addEventListener( | 342 launcher.addEventListener( |
| 343 'webkitTransitionEnd', function f(e) { | 343 'transitionend', function f(e) { |
| 344 launcher.removeEventListener('webkitTransitionEnd', f); | 344 launcher.removeEventListener('transitionend', f); |
| 345 callback(); | 345 callback(); |
| 346 }); | 346 }); |
| 347 // Guard timer for 2 seconds + 200 ms + epsilon. | 347 // Guard timer for 2 seconds + 200 ms + epsilon. |
| 348 ensureTransitionEndEvent(launcher, 2250); | 348 ensureTransitionEndEvent(launcher, 2250); |
| 349 | 349 |
| 350 this.classList.remove('login-header-bar-animate-slow'); | 350 this.classList.remove('login-header-bar-animate-slow'); |
| 351 this.classList.add('login-header-bar-animate-fast'); | 351 this.classList.add('login-header-bar-animate-fast'); |
| 352 this.classList.add('login-header-bar-hidden'); | 352 this.classList.add('login-header-bar-hidden'); |
| 353 }, | 353 }, |
| 354 | 354 |
| 355 /** | 355 /** |
| 356 * Animates Header bar to appear on the screen. | 356 * Animates Header bar to appear on the screen. |
| 357 * | 357 * |
| 358 * @param {boolean} fast Whether the animation should complete quickly or | 358 * @param {boolean} fast Whether the animation should complete quickly or |
| 359 * slowly. | 359 * slowly. |
| 360 * @param {function()} callback will be called once animation is finished. | 360 * @param {function()} callback will be called once animation is finished. |
| 361 */ | 361 */ |
| 362 animateIn: function(fast, callback) { | 362 animateIn: function(fast, callback) { |
| 363 if (callback) { | 363 if (callback) { |
| 364 var launcher = this; | 364 var launcher = this; |
| 365 launcher.addEventListener( | 365 launcher.addEventListener( |
| 366 'webkitTransitionEnd', function f(e) { | 366 'transitionend', function f(e) { |
| 367 launcher.removeEventListener('webkitTransitionEnd', f); | 367 launcher.removeEventListener('transitionend', f); |
| 368 callback(); | 368 callback(); |
| 369 }); | 369 }); |
| 370 // Guard timer for 2 seconds + 200 ms + epsilon. | 370 // Guard timer for 2 seconds + 200 ms + epsilon. |
| 371 ensureTransitionEndEvent(launcher, 2250); | 371 ensureTransitionEndEvent(launcher, 2250); |
| 372 } | 372 } |
| 373 | 373 |
| 374 if (fast) { | 374 if (fast) { |
| 375 this.classList.remove('login-header-bar-animate-slow'); | 375 this.classList.remove('login-header-bar-animate-slow'); |
| 376 this.classList.add('login-header-bar-animate-fast'); | 376 this.classList.add('login-header-bar-animate-fast'); |
| 377 } else { | 377 } else { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 394 * Convenience wrapper of animateIn. | 394 * Convenience wrapper of animateIn. |
| 395 */ | 395 */ |
| 396 HeaderBar.animateIn = function(fast, callback) { | 396 HeaderBar.animateIn = function(fast, callback) { |
| 397 $('login-header-bar').animateIn(fast, callback); | 397 $('login-header-bar').animateIn(fast, callback); |
| 398 }; | 398 }; |
| 399 | 399 |
| 400 return { | 400 return { |
| 401 HeaderBar: HeaderBar | 401 HeaderBar: HeaderBar |
| 402 }; | 402 }; |
| 403 }); | 403 }); |
| OLD | NEW |