From 6e3f7678820d19631a40ca4fbb6a1105a7434fa2 Mon Sep 17 00:00:00 2001 From: OVSharova Date: Tue, 10 Jan 2023 16:02:13 +0300 Subject: [PATCH] bug 51943 --- .../main/lib/component/ComboBorderSize.js | 104 +++++++++++------- .../resources/less/combo-border-size.less | 61 +++++----- .../main/app/view/DropcapSettingsAdvanced.js | 14 +-- .../main/app/view/CellSettings.js | 22 ++-- .../main/app/view/FormatRulesEditDlg.js | 24 ++-- .../main/app/view/Toolbar.js | 24 ++-- .../main/resources/less/toolbar.less | 25 +---- 7 files changed, 138 insertions(+), 136 deletions(-) diff --git a/apps/common/main/lib/component/ComboBorderSize.js b/apps/common/main/lib/component/ComboBorderSize.js index 6401e6867..67b2670f7 100644 --- a/apps/common/main/lib/component/ComboBorderSize.js +++ b/apps/common/main/lib/component/ComboBorderSize.js @@ -65,7 +65,7 @@ define([ displayValue: null, pxValue: null, id: Common.UI.getId(), - offsety: undefined + imgId: undefined } } }); @@ -78,7 +78,7 @@ define([ template: _.template([ '
', '
', - '', + '', '', '
', '
', @@ -89,9 +89,11 @@ define([ '<% _.each(items, function(item) { %>', '
  • ', '<%= item.displayValue %>', - '<% if (item.offsety!==undefined) { %>', - '', - '<% } %>', + '', + '', + '', + '', + '', '
  • ', '<% }); %>', '', @@ -101,13 +103,13 @@ define([ initialize : function(options) { var txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt), data = [ - {displayValue: '0.5 ' + txtPt, value: 0.5, pxValue: 0.5, offsety: 0}, - {displayValue: '1 ' + txtPt, value: 1, pxValue: 1, offsety: 20}, //pxValue = 1.34px - {displayValue: '1.5 ' + txtPt, value: 1.5, pxValue: 2, offsety: 40}, - {displayValue: '2.25 ' + txtPt, value: 2.25,pxValue: 3, offsety: 60}, - {displayValue: '3 ' + txtPt, value: 3, pxValue: 4, offsety: 80}, - {displayValue: '4.5 ' + txtPt, value: 4.5, pxValue: 6, offsety: 100}, - {displayValue: '6 ' + txtPt, value: 6, pxValue: 8, offsety: 120} + {displayValue: '0.5 ' + txtPt, value: 0.5, pxValue: 0.5, imgId: 'half-pt'}, + {displayValue: '1 ' + txtPt, value: 1, pxValue: 1, imgId: 'one-pt'}, + {displayValue: '1.5 ' + txtPt, value: 1.5, pxValue: 2, imgId: 'one-and-half-pt'}, + {displayValue: '2.25 ' + txtPt, value: 2.25,pxValue: 3, imgId: 'two-and-quarter-pt'}, + {displayValue: '3 ' + txtPt, value: 3, pxValue: 4, imgId: 'three-pt'}, + {displayValue: '4.5 ' + txtPt, value: 4.5, pxValue: 6, imgId: 'four-and-half-pt'}, + {displayValue: '6 ' + txtPt, value: 6, pxValue: 8, imgId: 'six-pt'} ]; if (options.allowNoBorders !== false) data.unshift({displayValue: this.txtNoBorders, value: 0, pxValue: 0 }); @@ -144,11 +146,17 @@ define([ updateFormControl: function(record) { var formcontrol = $(this.el).find('.form-control'); - var image = formcontrol.find('> .image'); + var image = formcontrol.find('> .img-line'); var text = formcontrol.find('> .text'); if (record.get('value')>0) { - image.css('background-position', '10px -' + record.get('offsety') + 'px').show(); + var elm = formcontrol.find('use'); + if(elm.length>0) { + elm[0].setAttribute('xlink:href', '#' + record.get('imgId')); + elm.parent().css('margin-top', (- Math.ceil(record.get('pxValue')/2))+'px'); + elm.parent().css('height', Math.ceil(record.get('pxValue'))+'px'); + } + image.show(); text.hide(); } else { image.hide(); @@ -190,10 +198,14 @@ define([ '', @@ -204,13 +216,13 @@ define([ this.txtNoBorders = options.txtNoBorders || this.txtNoBorders; var txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt), data = [ - {displayValue: '0.5 ' + txtPt, value: 0.5, pxValue: 0.5, offsety: 0}, - {displayValue: '1 ' + txtPt, value: 1, pxValue: 1, offsety: 20}, - {displayValue: '1.5 ' + txtPt, value: 1.5, pxValue: 2, offsety: 40}, - {displayValue: '2.25 ' + txtPt, value: 2.25,pxValue: 3, offsety: 60}, - {displayValue: '3 ' + txtPt, value: 3, pxValue: 4, offsety: 80}, - {displayValue: '4.5 ' + txtPt, value: 4.5, pxValue: 6, offsety: 100}, - {displayValue: '6 ' + txtPt, value: 6, pxValue: 8, offsety: 120} + {displayValue: '0.5 ' + txtPt, value: 0.5, pxValue: 0.5, imgId: 'half-pt'}, + {displayValue: '1 ' + txtPt, value: 1, pxValue: 1, imgId: 'one-pt'}, + {displayValue: '1.5 ' + txtPt, value: 1.5, pxValue: 2, imgId: 'one-and-half-pt'}, + {displayValue: '2.25 ' + txtPt, value: 2.25,pxValue: 3, imgId: 'two-and-quarter-pt'}, + {displayValue: '3 ' + txtPt, value: 3, pxValue: 4, imgId: 'three-pt'}, + {displayValue: '4.5 ' + txtPt, value: 4.5, pxValue: 6, imgId: 'four-and-half-pt'}, + {displayValue: '6 ' + txtPt, value: 6, pxValue: 8, imgId: 'six-pt'} ]; if (options.allowNoBorders !== false) @@ -236,7 +248,7 @@ define([ template: _.template([ '
    ', '
    ', - '', + '', '
    ', '
    ', '', '