From 5631cb24f70f1925b80d7bf692f338e767096259 Mon Sep 17 00:00:00 2001 From: Alexey Koshelev Date: Mon, 5 May 2025 13:58:09 +0300 Subject: [PATCH] [DE PDFE PE SSE] Fix print panel --- .../main/app/controller/Print.js | 7 ++++- .../main/app/view/FileMenuPanels.js | 4 +-- .../main/resources/less/filemenu.less | 13 ++++++++++ apps/pdfeditor/main/app/controller/Print.js | 7 ++++- .../pdfeditor/main/app/view/FileMenuPanels.js | 4 +-- .../main/resources/less/filemenu.less | 13 ++++++++++ .../main/app/controller/Print.js | 2 +- .../main/app/view/FileMenuPanels.js | 25 ++---------------- .../main/resources/less/leftmenu.less | 13 ++++++++++ .../main/app/controller/Print.js | 2 +- .../main/app/view/FileMenuPanels.js | 4 +-- .../main/app/view/PrintSettings.js | 26 +++++++++---------- .../main/resources/less/leftmenu.less | 16 +++++++++++- 13 files changed, 89 insertions(+), 47 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Print.js b/apps/documenteditor/main/app/controller/Print.js index 8ce6c24738..2707b7af8d 100644 --- a/apps/documenteditor/main/app/controller/Print.js +++ b/apps/documenteditor/main/app/controller/Print.js @@ -81,7 +81,7 @@ define([ this.printSettings.menu.on('menu:hide', _.bind(this.onHidePrintMenu, this)); this.printSettings.btnPrintSystemDialog.on('click', _.bind(this.onBtnPrint, this, true, true)); this.printSettings.btnPrint.on('click', _.bind(this.onBtnPrint, this, true, false)); - this.printSettings.btnPrintPdf.on('click', _.bind(this.onBtnPrint, this, false)); + this.printSettings.btnPrintPdf.on('click', _.bind(this.onBtnPrint, this, false, false)); this.printSettings.btnPrevPage.on('click', _.bind(this.onChangePreviewPage, this, false)); this.printSettings.btnNextPage.on('click', _.bind(this.onChangePreviewPage, this, true)); this.printSettings.txtNumberPage.on({ @@ -189,7 +189,12 @@ define([ height = this._state.pgorient ? h : w; var panel = this.printSettings; var store = panel.cmbPaperSize.store, + cmbPaperSizeRecord = panel.cmbPaperSize.getSelectedRecord(), item = null; + + if (cmbPaperSizeRecord && Math.abs(w - cmbPaperSizeRecord.size[0]) < 0.1 && Math.abs(h - cmbPaperSizeRecord.size[1]) < 0.1) { + return; + } for (var i=0; i a { + overflow: hidden; + text-overflow: ellipsis; + } + } } } #print-navigation { diff --git a/apps/pdfeditor/main/app/controller/Print.js b/apps/pdfeditor/main/app/controller/Print.js index 6e01c2da8b..ec674df37c 100644 --- a/apps/pdfeditor/main/app/controller/Print.js +++ b/apps/pdfeditor/main/app/controller/Print.js @@ -82,7 +82,7 @@ define([ this.printSettings.menu.on('menu:hide', _.bind(this.onHidePrintMenu, this)); this.printSettings.btnPrintSystemDialog.on('click', _.bind(this.onBtnPrint, this, true, true)); this.printSettings.btnPrint.on('click', _.bind(this.onBtnPrint, this, true, false)); - this.printSettings.btnPrintPdf.on('click', _.bind(this.onBtnPrint, this, false)); + this.printSettings.btnPrintPdf.on('click', _.bind(this.onBtnPrint, this, false, false)); this.printSettings.btnPrevPage.on('click', _.bind(this.onChangePreviewPage, this, false)); this.printSettings.btnNextPage.on('click', _.bind(this.onChangePreviewPage, this, true)); this.printSettings.txtNumberPage.on({ @@ -190,7 +190,12 @@ define([ height = this._state.pgorient ? h : w; var panel = this.printSettings; var store = panel.cmbPaperSize.store, + cmbPaperSizeRecord = panel.cmbPaperSize.getSelectedRecord(), item = null; + + if (cmbPaperSizeRecord && Math.abs(w - cmbPaperSizeRecord.size[0]) < 0.1 && Math.abs(h - cmbPaperSizeRecord.size[1]) < 0.1) { + return; + } for (var i=0; i a { + overflow: hidden; + text-overflow: ellipsis; + } + } } } #print-navigation { diff --git a/apps/presentationeditor/main/app/controller/Print.js b/apps/presentationeditor/main/app/controller/Print.js index 1402b485dd..55ec97d267 100644 --- a/apps/presentationeditor/main/app/controller/Print.js +++ b/apps/presentationeditor/main/app/controller/Print.js @@ -82,7 +82,7 @@ define([ this.printSettings.menu.on('menu:hide', _.bind(this.onHidePrintMenu, this)); this.printSettings.btnPrintSystemDialog.on('click', _.bind(this.onBtnPrint, this, true, true)); this.printSettings.btnPrint.on('click', _.bind(this.onBtnPrint, this, true, false)); - this.printSettings.btnPrintPdf.on('click', _.bind(this.onBtnPrint, this, false)); + this.printSettings.btnPrintPdf.on('click', _.bind(this.onBtnPrint, this, false, false)); this.printSettings.btnPrevPage.on('click', _.bind(this.onChangePreviewPage, this, false)); this.printSettings.btnNextPage.on('click', _.bind(this.onChangePreviewPage, this, true)); this.printSettings.txtNumberPage.on({ diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index a834ee8c15..e1611b4779 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -2197,28 +2197,7 @@ define([], function () { this.cmbPrinter = new Common.UI.ComboBox({ el: $markup.findById('#print-combo-printer'), - menuStyle: 'min-width: 248px;max-height: 280px;', - editable: false, - takeFocusOnClose: true, - cls: 'input-group-nr', - placeHolder: this.txtPrinterNotSelected, - itemsTemplate: _.template([ - '<% if (items.length > 0) { %>', - '<% _.each(items, function(item) { %>', - '
  • class="checked" <% } %> ><%= scope.getDisplayValue(item) %>
  • ', - '<% }); %>', - '<% } else { %>', - '
  • ' + this.txtPrintersNotFound + '
  • ', - '<% } %>' - ].join('')), - data: [], - dataHint: '2', - dataHintDirection: 'bottom', - dataHintOffset: 'big' - }); - this.cmbPrinter.on('selected', _.bind(this.onPrinterSelected, this));this.cmbPrinter = new Common.UI.ComboBox({ - el: $markup.findById('#print-combo-printer'), - menuStyle: 'min-width: 248px;max-height: 280px;', + menuStyle: 'width: 248px;max-height: 280px;', editable: false, takeFocusOnClose: true, cls: 'input-group-nr', @@ -2339,7 +2318,7 @@ define([], function () { this.cmbPaperSize = new Common.UI.ComboBoxCustom({ el: $markup.findById('#print-combo-pages'), - menuStyle: 'max-height: 280px; min-width: 248px;', + menuStyle: 'max-height: 280px; width: 248px;', editable: false, takeFocusOnClose: true, template: paperSizeTemplate, diff --git a/apps/presentationeditor/main/resources/less/leftmenu.less b/apps/presentationeditor/main/resources/less/leftmenu.less index 578c1ff23a..51713e70f8 100644 --- a/apps/presentationeditor/main/resources/less/leftmenu.less +++ b/apps/presentationeditor/main/resources/less/leftmenu.less @@ -843,6 +843,19 @@ .padding-x(20px, 5px); } } + #print-combo-printer, + #print-combo-pages { + .form-control { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + display: block; + } + .dropdown-menu li > a { + overflow: hidden; + text-overflow: ellipsis; + } + } } } diff --git a/apps/spreadsheeteditor/main/app/controller/Print.js b/apps/spreadsheeteditor/main/app/controller/Print.js index 2001d0da91..d480ded12e 100644 --- a/apps/spreadsheeteditor/main/app/controller/Print.js +++ b/apps/spreadsheeteditor/main/app/controller/Print.js @@ -555,7 +555,7 @@ define([ pageSetup = props.asc_getPageSetup(), size = [pageSetup.asc_getWidth(), pageSetup.asc_getHeight()], orientation = pageSetup.asc_getOrientation(), - printerOption = this.printSettings.cmbPrinter.getSelectedRecord(); + printerOption = (this.printSettings.cmbPrinter ? this.printSettings.cmbPrinter.getSelectedRecord() : null); this.adjPrintParams.asc_setNativeOptions({ usesystemdialog: useSystemDialog, printer: printerOption ? printerOption.value : null, diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 23428d3733..9866aaf7f0 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -2843,7 +2843,7 @@ define([], function () { if(this.mode.isDesktopApp) { this.cmbPrinter = new Common.UI.ComboBox({ el: $markup.findById('#print-combo-printer'), - menuStyle: 'min-width: 248px;max-height: 280px;', + menuStyle: 'width: 248px; max-height: 280px;', editable: false, takeFocusOnClose: true, cls: 'input-group-nr', @@ -3006,7 +3006,7 @@ define([], function () { this.cmbPaperSize = new Common.UI.ComboBoxCustom({ el: $markup.findById('#print-combo-pages'), - menuStyle: 'max-height: 280px; min-width: 248px;', + menuStyle: 'max-height: 280px; width: 248px;', editable: false, takeFocusOnClose: true, template: paperSizeTemplate, diff --git a/apps/spreadsheeteditor/main/app/view/PrintSettings.js b/apps/spreadsheeteditor/main/app/view/PrintSettings.js index 5a1e1c7e24..bc6b5435da 100644 --- a/apps/spreadsheeteditor/main/app/view/PrintSettings.js +++ b/apps/spreadsheeteditor/main/app/view/PrintSettings.js @@ -148,19 +148,19 @@ define([ takeFocusOnClose: true, cls : 'input-group-nr', data : [ - {value:'215.9|279.4', displayValue:'US Letter (21,59 cm x 27,94 cm)', caption: 'US Letter'}, - {value:'215.9|355.6', displayValue:'US Legal (21,59 cm x 35,56 cm)', caption: 'US Legal'}, - {value:'210|297', displayValue:'A4 (21 cm x 29,7 cm)', caption: 'A4'}, - {value:'148|210', displayValue:'A5 (14,8 cm x 21 cm)', caption: 'A5'}, - {value:'176|250', displayValue:'B5 (17,6 cm x 25 cm)', caption: 'B5'}, - {value:'104.8|241.3', displayValue:'Envelope #10 (10,48 cm x 24,13 cm)', caption: 'Envelope #10'}, - {value:'110|220', displayValue:'Envelope DL (11 cm x 22 cm)', caption: 'Envelope DL'}, - {value:'279.4|431.8', displayValue:'Tabloid (27,94 cm x 43,18 cm)', caption: 'Tabloid'}, - {value:'297|420', displayValue:'A3 (29,7 cm x 42 cm)', caption: 'A3'}, - {value:'296.9|457.2', displayValue:'Tabloid Oversize (29,69 cm x 45,72 cm)', caption: 'Tabloid Oversize'}, - {value:'196.8|273', displayValue:'ROC 16K (19,68 cm x 27,3 cm)', caption: 'ROC 16K'}, - {value:'120|235', displayValue:'Envelope Choukei 3 (12 cm x 23,5 cm)', caption: 'Envelope Choukei 3'}, - {value:'305|487', displayValue:'Super B/A3 (30,5 cm x 48,7 cm)', caption: 'Super B/A3'} + {value:'215.9|279.4', displayValue:'US Letter (21,59 cm x 27,94 cm)', caption: 'US Letter', size: [215.9, 279.4]}, + {value:'215.9|355.6', displayValue:'US Legal (21,59 cm x 35,56 cm)', caption: 'US Legal', size: [215.9, 355.6]}, + {value:'210|297', displayValue:'A4 (21 cm x 29,7 cm)', caption: 'A4', size: [210, 297]}, + {value:'148|210', displayValue:'A5 (14,8 cm x 21 cm)', caption: 'A5', size: [148, 210]}, + {value:'176|250', displayValue:'B5 (17,6 cm x 25 cm)', caption: 'B5', size: [176, 250]}, + {value:'104.8|241.3', displayValue:'Envelope #10 (10,48 cm x 24,13 cm)', caption: 'Envelope #10', size: [104.8, 241.3]}, + {value:'110|220', displayValue:'Envelope DL (11 cm x 22 cm)', caption: 'Envelope DL', size: [110, 220]}, + {value:'279.4|431.8', displayValue:'Tabloid (27,94 cm x 43,18 cm)', caption: 'Tabloid', size: [279.4, 431.8]}, + {value:'297|420', displayValue:'A3 (29,7 cm x 42 cm)', caption: 'A3', size: [297, 420]}, + {value:'296.9|457.2', displayValue:'Tabloid Oversize (29,69 cm x 45,72 cm)', caption: 'Tabloid Oversize', size: [296.9, 457.2]}, + {value:'196.8|273', displayValue:'ROC 16K (19,68 cm x 27,3 cm)', caption: 'ROC 16K', size: [196.8, 273]}, + {value:'120|235', displayValue:'Envelope Choukei 3 (12 cm x 23,5 cm)', caption: 'Envelope Choukei 3', size: [120, 235]}, + {value:'305|487', displayValue:'Super B/A3 (30,5 cm x 48,7 cm)', caption: 'Super B/A3', size: [305, 487]} ] }); diff --git a/apps/spreadsheeteditor/main/resources/less/leftmenu.less b/apps/spreadsheeteditor/main/resources/less/leftmenu.less index bac145886e..b76765f1bd 100644 --- a/apps/spreadsheeteditor/main/resources/less/leftmenu.less +++ b/apps/spreadsheeteditor/main/resources/less/leftmenu.less @@ -948,8 +948,22 @@ #print-combo-sides { .dropdown-menu li > a { .padding-x(20px, 5px); - } + } } + #print-combo-printer, + #print-combo-pages { + .form-control { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + display: block; + } + .dropdown-menu li > a { + overflow: hidden; + text-overflow: ellipsis; + } + } + .print-titles-header { cursor: pointer; .print-titles-caret {