OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 var DIGIT_LENGTH = 0.6; | 5 var DIGIT_LENGTH = 0.6; |
6 | 6 |
7 Polymer('viewer-page-selector', { | 7 Polymer('viewer-page-selector', { |
8 // The current entry in the input field (1-based). | 8 // The current entry in the input field (1-based). |
9 pageNo: '1', | 9 pageNo: '1', |
10 // The index of the current page being viewed (0-based). | 10 // The index of the current page being viewed (0-based). |
(...skipping 14 matching lines...) Expand all Loading... |
25 } | 25 } |
26 }, | 26 }, |
27 | 27 |
28 indexChanged: function() { | 28 indexChanged: function() { |
29 this.pageNo = String(this.index + 1); | 29 this.pageNo = String(this.index + 1); |
30 }, | 30 }, |
31 | 31 |
32 docLengthChanged: function() { | 32 docLengthChanged: function() { |
33 var numDigits = this.docLength.toString().length; | 33 var numDigits = this.docLength.toString().length; |
34 this.$.pageselector.style.width = (numDigits * DIGIT_LENGTH) + 'em'; | 34 this.$.pageselector.style.width = (numDigits * DIGIT_LENGTH) + 'em'; |
| 35 }, |
| 36 |
| 37 select: function() { |
| 38 this.$.input.select(); |
35 } | 39 } |
36 }); | 40 }); |
OLD | NEW |