diff options
author | dpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-16 00:48:20 +0000 |
---|---|---|
committer | dpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-16 00:48:20 +0000 |
commit | 02b3f8cfe1f3e7920d6d0223ab9a08f2d919e93b (patch) | |
tree | 1c99f4b242dcfcf50f385ebf54c1a499efebae26 | |
parent | 83e50b108dc8c178f916d912bf87de101a673860 (diff) | |
download | chromium_src-02b3f8cfe1f3e7920d6d0223ab9a08f2d919e93b.zip chromium_src-02b3f8cfe1f3e7920d6d0223ab9a08f2d919e93b.tar.gz chromium_src-02b3f8cfe1f3e7920d6d0223ab9a08f2d919e93b.tar.bz2 |
Reseting page range text field when user changes printing orientation.
BUG=79521
TEST=In the print preview tab, select a specific page range, then switch
printing orientation, the page range selection should be reset.
Review URL: http://codereview.chromium.org/6869026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81842 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/resources/print_preview.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/chrome/browser/resources/print_preview.js b/chrome/browser/resources/print_preview.js index f6a35db..1686ba9 100644 --- a/chrome/browser/resources/print_preview.js +++ b/chrome/browser/resources/print_preview.js @@ -26,8 +26,8 @@ function load() { $('copies').addEventListener('input', validateNumberOfCopies); $('copies').addEventListener('blur', handleCopiesFieldBlur); $('individual-pages').addEventListener('blur', handlePageRangesFieldBlur); - $('landscape').onclick = getPreview; - $('portrait').onclick = getPreview; + $('landscape').onclick = onLayoutModeToggle; + $('portrait').onclick = onLayoutModeToggle; $('color').onclick = getPreview; $('bw').onclick = getPreview; @@ -436,6 +436,18 @@ function handleTwoSidedClick(event) { } /** + * When the user switches printing orientation mode the page field selection is + * reset to "all pages selected". After the change the number of pages will be + * different and currently selected page numbers might no longer be valid. + * Even if they are still valid the content of these pages will be different. + */ +function onLayoutModeToggle() { + $('individual-pages').value = ''; + $('all-pages').checked = true; + getPreview(); +} + +/** * Returns a list of all pages in the specified ranges. If the page ranges can't * be parsed an empty list is returned. * |