Polymer({ is: 'ts-login', behaviors: [ Polymer.NeonAnimationRunnerBehavior, Polymer.TSConfigBehavior ], listeners: { 'neon-animation-finish': '_onNeonAnimationFinish' }, properties: { animationConfig: { value: function () { return { 'exit': { name: 'fade-out-animation', node: this } } } }, action: { type: String, computed: 'computeAction(config)' } }, computeAction: function(config) { return `${config.pathname}remote/login` }, /** * Reloads the page when the exit animation is finished */ _onNeonAnimationFinish: function () { if(!this.opened) { this.opened = true } else { location.reload() } }, /** * Launch the entry animation */ attached: function() { this.playAnimation('entry') }, /** * Display the login error message */ invalidForm: function() { this.$.loginError.classList.remove('hidden') }, /** * Submit the login form */ login: function () { this.$['login-form'].submit() }, /** * Play the exit animation */ validForm: function() { this.$.loginError.classList.add('hidden') this.playAnimation('exit') }, })