| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 Polymer({ |
| 6 is: 'oobe-welcome-md', |
| 7 |
| 8 properties: { |
| 9 disabled: { |
| 10 type: Boolean, |
| 11 value: false, |
| 12 }, |
| 13 currentLanguage: { |
| 14 type: String, |
| 15 value: 'English (US)', |
| 16 }, |
| 17 }, |
| 18 |
| 19 ready: function() { |
| 20 /** |
| 21 * Workaround for |
| 22 * https://github.com/PolymerElements/neon-animation/issues/32 |
| 23 * TODO(dzhioev): Remove when fixed in Polymer. |
| 24 */ |
| 25 var pages = this.$.animatedPages; |
| 26 delete pages._squelchNextFinishEvent; |
| 27 Object.defineProperty( |
| 28 pages, '_squelchNextFinishEvent', |
| 29 {get: function() { return false; }}); |
| 30 }, |
| 31 |
| 32 focus: function() { |
| 33 if (this.isWelcomeSectionActive_()) |
| 34 this.$.welcomeNextButton.focus(); |
| 35 else |
| 36 this.$.oobeNetworkSettings.focus(); |
| 37 }, |
| 38 |
| 39 onAnimationFinish_: function() { |
| 40 this.focus(); |
| 41 }, |
| 42 |
| 43 isRTL_: function() { |
| 44 return !!document.querySelector('html[dir=rtl]'); |
| 45 }, |
| 46 |
| 47 isWelcomeSectionActive_: function() { |
| 48 return this.$.animatedPages.selected == 'welcomeSection'; |
| 49 }, |
| 50 |
| 51 setUpPageTransitions_: function() { |
| 52 var isForward = true; |
| 53 var isRTL = this.isRTL_(); |
| 54 this.$.animatedPages.entryAnimation = |
| 55 'slide-from-' + (isRTL ? 'left' : 'right') + |
| 56 '-animation'; |
| 57 this.$.animatedPages.exitAnimation = |
| 58 'slide-' + (isRTL ? 'right' : 'left') + '-animation'; |
| 59 }, |
| 60 |
| 61 onWelcomeNextButtonClicked_: function() { |
| 62 $('oobe-connect').hidden = false; |
| 63 $('oobe-welcome-md').hidden = true; |
| 64 }, |
| 65 |
| 66 }); |
| OLD | NEW |