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
3 // found in the LICENSE file.
6 is
: 'viewer-password-screen-legacy',
11 value
: 'This document is password protected. Please enter a password.',
17 observer
: 'activeChanged'
32 this.$.password
.disabled
= false;
33 this.$.submit
.disabled
= false;
34 this.$.password
.focus();
35 this.$.password
.select();
39 // Prevent the default form submission behavior.
41 if (this.$.password
.value
.length
== 0)
43 this.$.password
.disabled
= true;
44 this.$.submit
.disabled
= true;
45 this.fire('password-submitted', {password
: this.$.password
.value
});
48 activeChanged: function() {
49 clearTimeout(this.timerId
);
50 this.timerId
= undefined;
52 this.style
.visibility
= 'visible';
53 this.style
.opacity
= 1;
54 this.$.password
.focus();
56 this.style
.opacity
= 0;
57 this.timerId
= setTimeout(function() {
58 this.style
.visibility
= 'hidden';