Skip to content

Commit f826369

Browse files
author
lvostinar
committed
SVY-9410 NG Tableview doesn't show checks centered verically but
truncates them
1 parent 931127e commit f826369

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
lines changed

servoy_ngclient/war/css/servoy.css

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,27 @@ input[type=date] {
3333
width: 0px!important;/*override value from ng-grid css*/
3434
}
3535

36-
/*align labels for radios and check groups with input element*/
36+
/*align labels for radios and check groups with input element;
37+
we should use flexbox instead of useless vertical-align*/
3738
label.svy-check-radio{
3839
display:block;
3940
}
40-
label.svy-check-radio input{
41+
label.svy-check-radio input[type="checkbox"],
42+
label.svy-check-radio input[type="radio"]{
4143
vertical-align:middle;
4244
margin:0px;
4345
}
4446

4547
label.svy-check-radio span{
4648
vertical-align: middle;
4749
}
48-
50+
label.svy-check{
51+
display:flex;
52+
align-items:center;
53+
}
54+
label.svy-check span{
55+
padding-left: 3px;
56+
}
4957
div.svy-label-with-focus:focus{
5058
border: thin solid black;
5159
}

servoy_ngclient/war/js/servoy.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,25 @@ angular.module('servoy',['sabloApp','servoyformat','servoytooltip','servoyfileup
262262
element.css(style);
263263
}
264264
},
265+
setHorizontalAlignmentFlexbox: function(element,halign) {
266+
if (halign != -1)
267+
{
268+
var style ={}
269+
if (halign == 0)
270+
{
271+
style['justify-content'] = 'center';
272+
}
273+
else if (halign == 4)
274+
{
275+
style['justify-content'] = 'flex-end';
276+
}
277+
else
278+
{
279+
style['justify-content'] = 'flex-start';
280+
}
281+
element.css(style);
282+
}
283+
},
265284
setVerticalAlignment: function(element,valign) {
266285
var style ={}
267286
if (valign == 1)

servoy_ngclient/war/servoydefault/check/check.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ angular.module('servoydefaultCheck', [ 'servoy' ]).directive('servoydefaultCheck
9696
$svyProperties.setCssProperty(element, "color", value);
9797
break;
9898
case "horizontalAlignment":
99-
$svyProperties.setHorizontalAlignment(element, value);
99+
$svyProperties.setHorizontalAlignmentFlexbox(element, value);
100100
break;
101101
case "toolTipText":
102102
if (tooltipState)

0 commit comments

Comments
 (0)