[SSE] Fix validation of page number in print settings
This commit is contained in:
parent
2aad186cdb
commit
f601862a87
|
@ -100,6 +100,7 @@ define([
|
|||
'keypress:after': _.bind(this.onKeypressPageNumber, this),
|
||||
'keyup:after': _.bind(this.onKeyupPageNumber, this)
|
||||
});
|
||||
this.printSettings.txtNumberPage.cmpEl.find('input').on('blur', _.bind(this.onBlurPageNumber, this));
|
||||
this.printSettings.chIgnorePrintArea.on('change', _.bind(this.updatePreview, this));
|
||||
|
||||
this.fillComponents(this.printSettings);
|
||||
|
@ -311,6 +312,7 @@ define([
|
|||
|
||||
var pageCount = this.api.asc_initPrintPreview('print-preview');
|
||||
this.updateNavigationButtons(0, pageCount);
|
||||
this.printSettings.txtNumberPage.checkValidate();
|
||||
|
||||
this._isPreviewVisible = true;
|
||||
},
|
||||
|
@ -642,7 +644,8 @@ define([
|
|||
edit = box.find('input[type=text]'), page = parseInt(edit.val());
|
||||
if (!page || page > this._navigationPreview.pageCount || page < 0) {
|
||||
edit.select();
|
||||
this.disableNavButtons(true);
|
||||
this.printSettings.txtNumberPage.setValue(this._navigationPreview.currentPage + 1);
|
||||
this.printSettings.txtNumberPage.checkValidate();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -665,6 +668,13 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
onBlurPageNumber: function () {
|
||||
if (this.printSettings.txtNumberPage.getValue() != this._navigationPreview.currentPage + 1) {
|
||||
this.printSettings.txtNumberPage.setValue(this._navigationPreview.currentPage + 1);
|
||||
this.printSettings.txtNumberPage.checkValidate();
|
||||
}
|
||||
},
|
||||
|
||||
updatePreview: function () {
|
||||
if (this._isPreviewVisible) {
|
||||
var adjPrintParams = new Asc.asc_CAdjustPrint(),
|
||||
|
|
Loading…
Reference in a new issue