Skip to content

Commit

Permalink
Merge pull request #2980 from ONLYOFFICE/fix/fix-bugs
Browse files Browse the repository at this point in the history
Fix/fix bugs
  • Loading branch information
JuliaRadzhabova authored May 7, 2024
2 parents 6691c0f + 34a423b commit 948eeba
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 48 deletions.
12 changes: 4 additions & 8 deletions apps/common/main/lib/component/Switcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,15 @@ define([

options : {
hint: false,
width: 25,
thumbWidth: 13,
width: 30,
thumbWidth: 12,
value: false
},

disabled: false,

template : _.template([
'<div class="switcher">',
'<div class="sw-left"></div>',
'<div class="sw-right"></div>',
'<div class="thumb"></div>',
'</div>'
].join('')),
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
};
Expand Down
45 changes: 10 additions & 35 deletions apps/common/main/resources/less/switcher.less
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
}
}
}
3 changes: 2 additions & 1 deletion apps/documenteditor/main/app/view/DateTimeDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
3 changes: 1 addition & 2 deletions apps/spreadsheeteditor/main/app/view/PivotSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 4 additions & 2 deletions apps/spreadsheeteditor/main/resources/less/rightmenu.less
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 948eeba

Please sign in to comment.