Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: chrome/browser/resources/pdf/elements/viewer-page-selector/viewer-page-selector.js

Issue 888343003: Ctrl-G now selects page number in Material Design PDF Viewer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix underline margin on input Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698