Merge pull request #1228 from ONLYOFFICE/fix/bug-50356

Fix/bug 50356
This commit is contained in:
maxkadushkin 2021-10-06 12:40:11 +03:00 committed by GitHub
commit f91d785ced
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 72 additions and 60 deletions

View file

@ -71,8 +71,13 @@ define([
disabled : false,
rendered : false,
template : _.template('<label class="radiobox" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>"><input type="radio" name="<%= name %>" id="<%= id %>" class="button__radiobox">' +
'<label for="<%= id %>" class="radiobox__shape"></label><span></span></label>'),
template : _.template('<div class="radiobox" data-hint="<%= dataHint %>" data-hint-direction="<%= dataHintDirection %>" data-hint-offset="<%= dataHintOffset %>">' +
'<input type="radio" name="<%= name %>" id="<%= id %>" class="button__radiobox">' +
'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">' +
'<circle class="rb-circle" cx="8" cy="8" r="6.5" />' +
'<circle class="rb-check-mark" cx="8" cy="8" r="4" />' +
'</svg>' +
'<span></span></div>'),
initialize : function(options) {
Common.UI.BaseView.prototype.initialize.call(this, options);
@ -96,7 +101,6 @@ define([
this.setCaption(this.options.labelText);
// handle events
this.$radio.on('click', _.bind(this.onItemCheck, this));
},
render: function () {
@ -111,9 +115,15 @@ define([
}));
this.$radio = el.find('input[type=radio]');
this.$label = el.find('label.radiobox');
this.$label = el.find('div.radiobox');
this.$span = this.$label.find('span');
this.$label.on('keydown', this.onKeyDown.bind(this));
this.$label.on({
'keydown': this.onKeyDown.bind(this),
'click': function(e){
if ( !this.disabled )
this.setValue(true);
}.bind(this),});
this.rendered = true;
return this;

View file

@ -1,72 +1,53 @@
.radiobox {
padding-left: 22px;
margin-bottom: 0;
.font-size-normal();
font-weight: normal;
position: relative;
min-height: 1em;
input[type=radio] {
display: flex;
align-items: center;
svg {
margin-right: 8px;
.rb-circle {
fill: @background-normal;
stroke: @border-regular-control;
}
.rb-check-mark {
fill: @text-normal;
}
}
input[type=radio] {
display: none;
+ label {
position: absolute;
left: 0;
margin-top: auto;
padding-bottom: 4px;
width: 14px;
height: 14px;
background: @background-normal-ie;
background: @background-normal;
border: @scaled-one-px-value-ie solid @border-regular-control-ie;
border: @scaled-one-px-value solid @border-regular-control;
border-radius: 50%;
+ span {
outline: @scaled-one-px-value-ie dotted transparent;
outline: @scaled-one-px-value dotted transparent;
display: inline-block;
}
}
&:checked {
+ label {
&::before {
content: '';
position: absolute;
background: @text-normal-ie;
background: @text-normal;
border-radius: 50%;
width: 8px;
height: 8px;
left: 2px;
top: 2px;
&:not(:checked) + svg {
.rb-check-mark {
display: none;
}
}
}
&.disabled, &:disabled {
+ label {
&::before {
}
}
svg, span {
opacity: @component-disabled-opacity;
pointer-events: none;
}
}
&:focus:not(.disabled) {
input[type=radio] {
+ label {
border-color: @border-control-focus-ie;
border-color: @border-control-focus;
svg {
.rb-circle {
stroke: @border-control-focus-ie;
stroke: @border-control-focus;
}
}
+ span {
outline-color: @border-control-focus-ie;
outline-color: @border-control-focus;
}
}
span {
outline: @scaled-one-px-value-ie dotted @border-control-focus-ie;
outline: @scaled-one-px-value dotted @border-control-focus;
}
}
}

View file

@ -79,8 +79,8 @@ define([
'<tr>',
'<td class="padding-extra-small">',
'<label class="header" style="margin-right: 10px;">', me.textSort,'</label>',
'<div id="bookmarks-radio-name" style="display: inline-block; margin-right: 10px;"></div>',
'<div id="bookmarks-radio-location" style="display: inline-block;"></div>',
'<div id="bookmarks-radio-name"></div>',
'<div id="bookmarks-radio-location"></div>',
'</td>',
'</tr>',
'<tr>',

View file

@ -91,8 +91,8 @@ define([
'</tr>',
'<tr>',
'<td style="padding-bottom: 5px;">',
'<div id="id-text-table-radio-fixed" style="display: inline-block;margin-right: 10px;"></div>',
'<div id="id-text-table-spn-fixed" style="display: inline-block;"></div>',
'<div id="id-text-table-radio-fixed"></div>',
'<div id="id-text-table-spn-fixed"></div>',
'</td>',
'</tr>',
'<tr>',

View file

@ -74,3 +74,24 @@
border: @scaled-one-px-value-ie solid @border-regular-control-ie;
border: @scaled-one-px-value solid @border-regular-control;
}
#id-text-table-radio-fixed {
display: inline-block;
margin-right: 10px;
vertical-align: middle;
.pixel-ratio__1_75 &, .pixel-ratio__2 & {
padding-bottom: 1px;
}
}
#bookmarks-radio-name {
display: inline-block;
margin-right: 10px;
vertical-align: middle;
}
#id-text-table-spn-fixed, #bookmarks-radio-location {
display: inline-block;
vertical-align: middle;
}