Commit 799332b7 authored by dpapad@chromium.org's avatar dpapad@chromium.org

Print Preview: Delaying page range validation

Also 
1) adding border between printing controls and preview area. 
2) showing an error message when initiator tab is closed regardless of the state of the preview area.

BUG=83251, 83429, 83410
TEST=See bug description.


Review URL: http://codereview.chromium.org/7055018

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86196 0039d316-1c4b-4281-b951-d872f2087c98
parent a02c61e7
...@@ -37,6 +37,7 @@ body #main:after { ...@@ -37,6 +37,7 @@ body #main:after {
.sidebar { .sidebar {
-webkit-user-select: none; -webkit-user-select: none;
border: 1px solid #a0a0a0;
background: white; background: white;
height: 100%; height: 100%;
overflow-x: hidden; overflow-x: hidden;
......
...@@ -64,7 +64,7 @@ function onLoad() { ...@@ -64,7 +64,7 @@ function onLoad() {
onPageSelectionMayHaveChanged(); onPageSelectionMayHaveChanged();
}); });
$('individual-pages').addEventListener('focus', addTimerToPageRangeField); $('individual-pages').addEventListener('focus', addTimerToPageRangeField);
$('individual-pages').addEventListener('input', pageRangesFieldChanged); $('individual-pages').addEventListener('input', resetPageRangeFieldTimer);
$('two-sided').addEventListener('click', handleTwoSidedClick) $('two-sided').addEventListener('click', handleTwoSidedClick)
$('landscape').addEventListener('click', onLayoutModeToggle); $('landscape').addEventListener('click', onLayoutModeToggle);
$('portrait').addEventListener('click', onLayoutModeToggle); $('portrait').addEventListener('click', onLayoutModeToggle);
...@@ -101,15 +101,8 @@ function showSystemDialog() { ...@@ -101,15 +101,8 @@ function showSystemDialog() {
* @param {string} initiatorTabURL The URL of the initiator tab. * @param {string} initiatorTabURL The URL of the initiator tab.
*/ */
function onInitiatorTabClosed(initiatorTabURL) { function onInitiatorTabClosed(initiatorTabURL) {
if (isPreviewStillLoading) displayErrorMessage(localStrings.getStringF('initiatorTabClosed',
displayErrorMessage(localStrings.getStringF('initiatorTabClosed', initiatorTabURL));
initiatorTabURL));
var controlIDs = ['landscape', 'portrait', 'all-pages', 'print-pages',
'individual-pages', 'printer-list'];
var controlCount = controlIDs.length;
for (var i = 0; i < controlCount; i++)
$(controlIDs[i]).disabled = true;
} }
/** /**
...@@ -537,8 +530,8 @@ function copiesFieldChanged() { ...@@ -537,8 +530,8 @@ function copiesFieldChanged() {
} }
/** /**
* Executes whenever an input event occurs on the 'individual-pages' * Executes whenever a blur event occurs on the 'individual-pages'
* field. It takes care of * field or when the timer expires. It takes care of
* 1) showing/hiding warnings/suggestions * 1) showing/hiding warnings/suggestions
* 2) updating print button/summary * 2) updating print button/summary
*/ */
...@@ -661,7 +654,6 @@ function handleTwoSidedClick() { ...@@ -661,7 +654,6 @@ function handleTwoSidedClick() {
* clicked. * clicked.
*/ */
function handleIndividualPagesCheckbox() { function handleIndividualPagesCheckbox() {
onPageSelectionMayHaveChanged();
$('individual-pages').focus(); $('individual-pages').focus();
} }
...@@ -860,6 +852,8 @@ function resetPageRangeFieldTimer() { ...@@ -860,6 +852,8 @@ function resetPageRangeFieldTimer() {
* 2) The newly selected pages differ from the previously selected. * 2) The newly selected pages differ from the previously selected.
*/ */
function onPageSelectionMayHaveChanged() { function onPageSelectionMayHaveChanged() {
if ($('print-pages').checked)
pageRangesFieldChanged();
var validityLevel = getSelectedPagesValidityLevel(); var validityLevel = getSelectedPagesValidityLevel();
var currentlySelectedPages = getSelectedPagesSet(); var currentlySelectedPages = getSelectedPagesSet();
......
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