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

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

Issue 1162863002: Material PDF: Fix inconsistent behaviour in page selector, update styling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/pdf/elements/viewer-page-selector/viewer-page-selector.js
diff --git a/chrome/browser/resources/pdf/elements/viewer-page-selector/viewer-page-selector.js b/chrome/browser/resources/pdf/elements/viewer-page-selector/viewer-page-selector.js
index fb6ff6cdaa6c09b2e9bea6b2e43c7120f7e0d93e..8ebdf0525b36202ebb82dc8d579703f4d2ecf99f 100644
--- a/chrome/browser/resources/pdf/elements/viewer-page-selector/viewer-page-selector.js
+++ b/chrome/browser/resources/pdf/elements/viewer-page-selector/viewer-page-selector.js
@@ -31,13 +31,21 @@ Polymer({
*/
pageNo: {
type: String,
- value: '1',
- observer: 'pageNoChanged'
- },
+ value: '1'
+ }
+ },
+
+ ready: function() {
+ // Polymer 0.8's iron-input's validation method has a bug which resets the
+ // cursor position to the end of the input field after every character is
+ // typed. This makes editing text in the middle of the input difficult.
+ // Since we don't use the input validation, just disable it.
+ // TODO(tsergeant): Remove this once we have iron-input >= 0.9.5 available.
+ this.$.input._onInput = null;
raymes 2015/06/02 01:12:03 Will we be able to remove this before you land thi
tsergeant 2015/06/02 05:00:39 Yes, since I'll be waiting for the Polymer 1.0 pat
},
- pageNoChanged: function() {
- var page = parseInt(this.pageNo);
+ pageNoCommitted: function(e) {
+ var page = parseInt(e.target.value);
raymes 2015/06/02 01:12:03 is e.target.value the same as this.pageNo?
tsergeant 2015/06/02 05:00:39 Done.
if (!isNaN(page) && page != this.index + 1) {
this.fire('change-page', {page: page - 1});
} else {

Powered by Google App Engine
This is Rietveld 408576698