Merge pull request #1404 from ONLYOFFICE/fix/bugfix

Fix/bugfix
This commit is contained in:
Julia Radzhabova 2021-12-09 18:30:21 +03:00 committed by GitHub
commit 636ecb60da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 6 deletions

View file

@ -808,14 +808,14 @@ define([
};
var el = $(this.dataViewItems[0].el),
itemW = el.outerWidth() + parseInt(el.css('margin-left')) + parseInt(el.css('margin-right')),
itemW = el.outerWidth() + parseFloat(el.css('margin-left')) + parseFloat(el.css('margin-right')),
offsetLeft = this.$el.offset().left,
offsetTop = el.offset().top,
prevtop = -1, topIdx = 0, leftIdx = 0;
for (var i=0; i<this.dataViewItems.length; i++) {
var top = $(this.dataViewItems[i].el).offset().top - offsetTop;
leftIdx = Math.floor(($(this.dataViewItems[i].el).offset().left - offsetLeft)/itemW);
leftIdx = Math.floor(($(this.dataViewItems[i].el).offset().left - offsetLeft)/itemW + 0.01);
if (top>prevtop) {
prevtop = top;
this._layoutParams.itemsIndexes.push([]);
@ -1266,7 +1266,7 @@ define([
};
var el = this.dataViewItems[0].el,
itemW = el.outerWidth() + parseInt(el.css('margin-left')) + parseInt(el.css('margin-right')),
itemW = el.outerWidth() + parseFloat(el.css('margin-left')) + parseFloat(el.css('margin-right')),
offsetLeft = this.$el.offset().left,
offsetTop = el.offset().top,
prevtop = -1, topIdx = 0, leftIdx = 0;

View file

@ -278,7 +278,9 @@ define([
/** coauthoring end **/
'<tr class="themes">',
'<td class="left"><label><%= scope.strTheme %></label></td>',
'<td class="right"><span id="fms-cmb-theme"></span></td>',
'<td class="right">',
'<div><div id="fms-cmb-theme" style="display: inline-block; margin-right: 15px;vertical-align: middle;"></div>',
'<div id="fms-chb-dark-mode" style="display: inline-block; vertical-align: middle;margin-top: 2px;"></div></div></td>',
'</tr>','<tr class="divider"></tr>',
'<tr>',
'<td class="left"><label><%= scope.strZoom %></label></td>',
@ -547,6 +549,16 @@ define([
dataHint: '2',
dataHintDirection: 'bottom',
dataHintOffset: 'big'
}).on('selected', function(combo, record) {
me.chDarkMode.setDisabled(record.themeType!=='dark');
});
this.chDarkMode = new Common.UI.CheckBox({
el: $markup.findById('#fms-chb-dark-mode'),
labelText: this.txtDarkMode,
dataHint: '2',
dataHintDirection: 'left',
dataHintOffset: 'small'
});
this.cmbReviewHover = new Common.UI.ComboBox({
@ -636,6 +648,7 @@ define([
if ( !Common.UI.Themes.available() ) {
$('tr.themes, tr.themes + tr.divider', this.el).hide();
}
this.chDarkMode.setVisible(!/^pdf|djvu|xps|oxps$/.test(DE.getController('Main').document.fileType));
},
setApi: function(o) {
@ -700,7 +713,7 @@ define([
var data = [];
for (var t in Common.UI.Themes.map()) {
data.push({value: t, displayValue: Common.UI.Themes.get(t).text});
data.push({value: t, displayValue: Common.UI.Themes.get(t).text, themeType: Common.UI.Themes.get(t).type});
}
if ( data.length ) {
@ -708,6 +721,8 @@ define([
item = this.cmbTheme.store.findWhere({value: Common.UI.Themes.currentThemeId()});
this.cmbTheme.setValue(item ? item.get('value') : Common.UI.Themes.defaultThemeId());
}
this.chDarkMode.setValue(Common.UI.Themes.isContentThemeDark());
this.chDarkMode.setDisabled(!Common.UI.Themes.isDarkTheme());
if (this.mode.canViewReview) {
value = Common.Utils.InternalSettings.get("de-settings-review-hover-mode");
@ -718,6 +733,8 @@ define([
applySettings: function() {
Common.UI.Themes.setTheme(this.cmbTheme.getValue());
if (!this.chDarkMode.isDisabled() && (this.chDarkMode.isChecked() !== Common.UI.Themes.isContentThemeDark()))
Common.UI.Themes.toggleContentTheme();
Common.localStorage.setItem("de-settings-inputmode", this.chInputMode.isChecked() ? 1 : 0);
Common.localStorage.setItem("de-settings-zoom", this.cmbZoom.getValue());
Common.Utils.InternalSettings.set("de-settings-zoom", Common.localStorage.getItem("de-settings-zoom"));
@ -852,7 +869,8 @@ define([
txtAutoCorrect: 'AutoCorrect options...',
strReviewHover: 'Track Changes Display',
txtChangesTip: 'Show by hover in tooltips',
txtChangesBalloons: 'Show by click in balloons'
txtChangesBalloons: 'Show by click in balloons',
txtDarkMode: 'Turn on document dark mode'
}, DE.Views.FileMenuPanels.Settings || {}));
DE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({

View file

@ -1723,6 +1723,7 @@
"DE.Views.FileMenuPanels.Settings.strSpellCheckMode": "Turn on spell checking option",
"DE.Views.FileMenuPanels.Settings.strStrict": "Strict",
"DE.Views.FileMenuPanels.Settings.strTheme": "Interface theme",
"DE.Views.FileMenuPanels.Settings.txtDarkMode": "Turn on document dark mode",
"DE.Views.FileMenuPanels.Settings.strUnit": "Unit of Measurement",
"DE.Views.FileMenuPanels.Settings.strZoom": "Default Zoom Value",
"DE.Views.FileMenuPanels.Settings.text10Minutes": "Every 10 Minutes",

View file

@ -1723,6 +1723,7 @@
"DE.Views.FileMenuPanels.Settings.strSpellCheckMode": "Включить проверку орфографии",
"DE.Views.FileMenuPanels.Settings.strStrict": "Строгий",
"DE.Views.FileMenuPanels.Settings.strTheme": "Тема интерфейса",
"DE.Views.FileMenuPanels.Settings.txtDarkMode": "Включить темный режим",
"DE.Views.FileMenuPanels.Settings.strUnit": "Единица измерения",
"DE.Views.FileMenuPanels.Settings.strZoom": "Стандартное значение масштаба",
"DE.Views.FileMenuPanels.Settings.text10Minutes": "Каждые 10 минут",