Commit 4970413d authored by rbpotter's avatar rbpotter Committed by Commit Bot

Print Preview Refresh: Fix some pages and link container polish bugs

- Make cr-input full height of radio button so there is no border
area where the hand pointer appears.
- Ignore pointer events on link container when disabled.
- Fix bug where "----" was considered valid input in pages.

Bug: 884603, 887823, 888493
Change-Id: Ie9b7f2c42b12d7e2a7026f405b1a61b774578589
Reviewed-on: https://chromium-review.googlesource.com/1242037Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594013}
parent 8894113d
...@@ -9,6 +9,10 @@ ...@@ -9,6 +9,10 @@
<dom-module id="print-preview-link-container"> <dom-module id="print-preview-link-container">
<template> <template>
<style include="print-preview-shared throbber cr-hidden-style"> <style include="print-preview-shared throbber cr-hidden-style">
:host([disabled]) {
pointer-events: none;
}
.throbber { .throbber {
margin: 8px; margin: 8px;
min-height: 16px; min-height: 16px;
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#pageSettingsCustomInput { #pageSettingsCustomInput {
cursor: default; cursor: default;
height: 100%;
} }
</style> </style>
<print-preview-settings-section <print-preview-settings-section
......
...@@ -139,7 +139,14 @@ Polymer({ ...@@ -139,7 +139,14 @@ Polymer({
this.onRangeChange_(); this.onRangeChange_();
return this.pagesToPrint_; return this.pagesToPrint_;
} }
const limits = range.split('-'); const limits = range.split('-');
if (limits.length > 2) {
this.errorState_ = PagesInputErrorState.INVALID_SYNTAX;
this.onRangeChange_();
return this.pagesToPrint_;
}
let min = Number.parseInt(limits[0], 10); let min = Number.parseInt(limits[0], 10);
if ((limits[0].length > 0 && Number.isNaN(min)) || min < 1) { if ((limits[0].length > 0 && Number.isNaN(min)) || min < 1) {
this.errorState_ = PagesInputErrorState.INVALID_SYNTAX; this.errorState_ = PagesInputErrorState.INVALID_SYNTAX;
......
...@@ -172,6 +172,10 @@ cr.define('pages_settings_test', function() { ...@@ -172,6 +172,10 @@ cr.define('pages_settings_test', function() {
validateErrorState(syntaxError); validateErrorState(syntaxError);
return setupInput('-1,1,2\u3001\u300156', 100); return setupInput('-1,1,2\u3001\u300156', 100);
}) })
.then(function() {
validateErrorState(syntaxError);
return setupInput('--', 100);
})
.then(function() { .then(function() {
validateErrorState(syntaxError); validateErrorState(syntaxError);
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment