Merge pull request #2980 from ONLYOFFICE/fix/fix-bugs

Fix/fix bugs
This commit is contained in:
Julia Radzhabova
2024-05-07 12:51:05 +03:00
committed by GitHub
5 changed files with 21 additions and 48 deletions

View File

@ -47,8 +47,8 @@ define([
options : {
hint: false,
width: 25,
thumbWidth: 13,
width: 30,
thumbWidth: 12,
value: false
},
@ -56,8 +56,6 @@ define([
template : _.template([
'<div class="switcher">',
'<div class="sw-left"></div>',
'<div class="sw-right"></div>',
'<div class="thumb"></div>',
'</div>'
].join('')),
@ -108,8 +106,6 @@ define([
this.cmpEl.width(me.width);
this.thumb.width(me.thumbWidth);
this.cmpEl.find('.sw-left').width(me.width/2);
this.cmpEl.find('.sw-right').width(me.width/2);
var onMouseUp = function (e) {
if ( me.disabled ) return;
@ -140,9 +136,9 @@ define([
var pos = Math.round((e.pageX*Common.Utils.zoom() - me._dragstart));
if (me.value) {
me.thumb.css({right: (pos<1) ? Math.min(me.width-me.thumbWidth - 2, -pos) : 0, left: 'auto'});
me.thumb.css({right: (pos<1) ? Math.min(me.width-me.thumbWidth - 4, -pos) : 0, left: 'auto'});
} else {
me.thumb.css({left: (pos>-1) ? Math.min(me.width-me.thumbWidth - 2, pos) : 0, right: 'auto'});
me.thumb.css({left: (pos>-1) ? Math.min(me.width-me.thumbWidth - 4, pos) : 0, right: 'auto'});
}
if (!me._isMouseMove) me._isMouseMove = Math.abs(pos)>0;
};

View File

@ -1,42 +1,27 @@
.switcher {
position: relative;
width: 25px;
height: 15px;
background-color: transparent;
width: 30px;
height: 16px;
background-color: @border-preview-hover-ie;
background-color: @border-preview-hover;
border-radius: 11px;
cursor: pointer;
.sw-left {
display: inline-block;
height: 100%;
background-color: @highlight-button-pressed-ie;
background-color: @highlight-button-pressed;
border-top-left-radius: 2px;
border-bottom-left-radius: 2px;
}
.sw-right {
display: inline-block;
height: 100%;
background-color: @border-regular-control-ie;
background-color: @border-regular-control;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
}
.thumb {
position: absolute;
left: 0;
right: auto;
top: 0;
height: 100%;
height: 12px;
border-radius: 12px;
background-color: @background-normal-ie;
background-color: @background-normal;
border: 1px solid @highlight-button-pressed-ie;
border: 1px solid @highlight-button-pressed;
border-radius: 3px;
margin: 2px;
}
&.on {
background-color: @background-primary-dialog-button-ie;
background-color: @background-primary-dialog-button;
.thumb {
right: 0;
left: auto;
@ -47,15 +32,5 @@
cursor: default;
opacity: @component-disabled-opacity-ie;
opacity: @component-disabled-opacity;
.sw-left {
background-color: @border-regular-control-ie;
background-color: @border-regular-control;
}
.thumb {
border-color: @border-regular-control-ie;
border-color: @border-regular-control;
}
}
}

View File

@ -131,7 +131,8 @@ define([
store: new Common.UI.DataViewStore(),
tabindex: 1,
scrollAlwaysVisible: true,
cls: 'dbl-clickable'
cls: 'dbl-clickable',
itemTemplate: _.template('<div id="<%= id %>" class="list-item"><span dir="ltr"><%= value %></span></div>')
});
this.listFormats.on('item:select', _.bind(this.onSelectFormat, this));

View File

@ -351,13 +351,12 @@ define([
this.onMove(2, this.itemIndex, _.isNumber(this.indexMoveTo) ? (this.indexMoveTo !== 0 && this.itemIndex < this.indexMoveTo ? this.indexMoveTo - 1 : this.indexMoveTo) : this.valuesList.store.length - 1);
break;
}
} else {
$(this.el).find('.item').removeClass('insert last');
}
this.itemIndex = undefined;
this.indexMoveTo = undefined;
}
}
$(this.el).find('.item').removeClass('insert last');
},
openAdvancedSettings: function(e) {

View File

@ -238,9 +238,11 @@
padding: 3px;
border-top: none;
&.insert {
background: linear-gradient(to bottom, #656565, #fff 5%);
background: linear-gradient(to bottom, @text-normal-ie, @background-normal-ie 5%);
background: linear-gradient(to bottom, @text-normal, @background-normal 5%);
&.last {
background: linear-gradient(to top, #656565, #fff 5%);
background: linear-gradient(to top, @text-normal-ie, @background-normal-ie 5%);
background: linear-gradient(to top, @text-normal, @background-normal 5%);
}
}
&:hover {