[SSE] Print preview: fix print and save buttons

This commit is contained in:
JuliaSvinareva 2021-11-26 10:28:27 +03:00
parent 81dcc267ef
commit 267bb39e98
2 changed files with 21 additions and 13 deletions

View file

@ -85,10 +85,15 @@ define([
},
onAfterRender: function(view) {
var me = this;
this.printSettings.menu.on('menu:hide', _.bind(this.onHidePrintMenu, this));
this.printSettings.cmbSheet.on('selected', _.bind(this.comboSheetsChange, this, this.printSettings));
this.printSettings.btnSave.on('click', _.bind(this.querySavePrintSettings, this, false));
this.printSettings.btnPrint.on('click', _.bind(this.querySavePrintSettings, this, true));
this.printSettings.btnsSave.forEach(function (btn) {
btn.on('click', _.bind(me.querySavePrintSettings, me, false));
});
this.printSettings.btnsPrint.forEach(function (btn) {
btn.on('click', _.bind(me.querySavePrintSettings, me, true));
});
this.printSettings.btnPrevPage.on('click', _.bind(this.onChangePreviewPage, this, false));
this.printSettings.btnNextPage.on('click', _.bind(this.onChangePreviewPage, this, true));
this.printSettings.txtNumberPage.on({

View file

@ -2745,8 +2745,8 @@ define([
//'<tr><td class="padding-large"><button type="button" class="btn btn-text-default" id="print-apply-all" style="width: 118px;" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium"><%= scope.txtApplyToAllSheets %></button></td></tr>',
'<tr class="fms-btn-apply"><td>',
'<div class="footer justify">',
'<button id="print-btn-print" class="btn normal dlg-btn primary" result="print" style="width: 96px;" data-hint="2" data-hint-direction="bottom" data-hint-offset="big"><%= scope.txtPrint %></button>',
'<button id="print-btn-save" class="btn normal dlg-btn" result="save" style="width: 96px;" data-hint="2" data-hint-direction="bottom" data-hint-offset="big"><%= scope.txtSave %></button>',
'<button id="print-btn-print-0" class="btn normal dlg-btn primary" result="print" style="width: 96px;" data-hint="2" data-hint-direction="bottom" data-hint-offset="big"><%= scope.txtPrint %></button>',
'<button id="print-btn-save-0" class="btn normal dlg-btn" result="save" style="width: 96px;" data-hint="2" data-hint-direction="bottom" data-hint-offset="big"><%= scope.txtSave %></button>',
'</div>',
'</td></tr>',
'</tbody>',
@ -2754,8 +2754,8 @@ define([
'</div>',
'<div class="fms-flex-apply hidden">',
'<div class="footer justify">',
'<button id="print-btn-print" class="btn normal dlg-btn primary" result="print" style="width: 96px;" data-hint="2" data-hint-direction="bottom" data-hint-offset="big"><%= scope.txtPrint %></button>',
'<button id="print-btn-save" class="btn normal dlg-btn" result="save" style="width: 96px;" data-hint="2" data-hint-direction="bottom" data-hint-offset="big"><%= scope.txtSave %></button>',
'<button id="print-btn-print-1" class="btn normal dlg-btn primary" result="print" style="width: 96px;" data-hint="2" data-hint-direction="bottom" data-hint-offset="big"><%= scope.txtPrint %></button>',
'<button id="print-btn-save-1" class="btn normal dlg-btn" result="save" style="width: 96px;" data-hint="2" data-hint-direction="bottom" data-hint-offset="big"><%= scope.txtSave %></button>',
'</div>',
'</div>',
'</div>',
@ -3016,13 +3016,16 @@ define([
this.pnlTable = $(this.pnlSettings.find('table')[0]);
this.trApply = $markup.find('.fms-btn-apply');
this.btnSave = new Common.UI.Button({
el: $markup.findById('#print-btn-save')
});
this.btnPrint = new Common.UI.Button({
el: $markup.findById('#print-btn-print')
});
this.btnsSave = [];
this.btnsPrint = [];
for (var i=0; i<2; i++) {
this.btnsSave.push(new Common.UI.Button({
el: $markup.findById('#print-btn-save-'+i)
}));
this.btnsPrint.push(new Common.UI.Button({
el: $markup.findById('#print-btn-print-'+i)
}));
}
this.btnPrevPage = new Common.UI.Button({
parentEl: $markup.findById('#print-prev-page'),