Merge pull request #1166 from ONLYOFFICE/fix/bugfix

Fix/bugfix
This commit is contained in:
Julia Radzhabova 2021-09-08 20:31:51 +03:00 committed by GitHub
commit 3b45745018
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 86 additions and 30 deletions

View file

@ -91,6 +91,7 @@ define([
this.rendered = false; this.rendered = false;
this.needFillComboView = false; this.needFillComboView = false;
this.minWidth = this.options.minWidth; this.minWidth = this.options.minWidth;
this.delayRenderTips = this.options.delayRenderTips || false;
this.fieldPicker = new Common.UI.DataView({ this.fieldPicker = new Common.UI.DataView({
cls: 'field-picker', cls: 'field-picker',
@ -102,7 +103,8 @@ define([
'<span class="title"><%= title %></span>', '<span class="title"><%= title %></span>',
'<% } %>', '<% } %>',
'</div>' '</div>'
].join('')) ].join('')),
delayRenderTips: this.delayRenderTips
}); });
this.openButton = new Common.UI.Button({ this.openButton = new Common.UI.Button({
@ -137,7 +139,8 @@ define([
'<span class="title"><%= title %></span>', '<span class="title"><%= title %></span>',
'<% } %>', '<% } %>',
'</div>' '</div>'
].join('')) ].join('')),
delayRenderTips: this.delayRenderTips
}); });
// Handle resize // Handle resize

View file

@ -272,6 +272,7 @@ define([
me.allowScrollbar = (me.options.allowScrollbar!==undefined) ? me.options.allowScrollbar : true; me.allowScrollbar = (me.options.allowScrollbar!==undefined) ? me.options.allowScrollbar : true;
me.scrollAlwaysVisible = me.options.scrollAlwaysVisible || false; me.scrollAlwaysVisible = me.options.scrollAlwaysVisible || false;
me.tabindex = me.options.tabindex || 0; me.tabindex = me.options.tabindex || 0;
me.delayRenderTips = me.options.delayRenderTips || false;
if (me.parentMenu) if (me.parentMenu)
me.parentMenu.options.restoreHeight = (me.options.restoreHeight>0); me.parentMenu.options.restoreHeight = (me.options.restoreHeight>0);
me.rendered = false; me.rendered = false;
@ -454,14 +455,28 @@ define([
var idx = _.indexOf(this.store.models, record); var idx = _.indexOf(this.store.models, record);
this.dataViewItems = this.dataViewItems.slice(0, idx).concat(view).concat(this.dataViewItems.slice(idx)); this.dataViewItems = this.dataViewItems.slice(0, idx).concat(view).concat(this.dataViewItems.slice(idx));
if (record.get('tip')) { var me = this,
var view_el = $(view.el); view_el = $(view.el),
tip = record.get('tip');
if (tip) {
if (this.delayRenderTips)
view_el.one('mouseenter', function(){ // hide tooltip when mouse is over menu
view_el.attr('data-toggle', 'tooltip'); view_el.attr('data-toggle', 'tooltip');
view_el.tooltip({ view_el.tooltip({
title : record.get('tip'), title : tip,
placement : 'cursor', placement : 'cursor',
zIndex : this.tipZIndex zIndex : me.tipZIndex
}); });
view_el.mouseenter();
});
else {
view_el.attr('data-toggle', 'tooltip');
view_el.tooltip({
title : tip,
placement : 'cursor',
zIndex : me.tipZIndex
});
}
} }
this.listenTo(view, 'change', this.onChangeItem); this.listenTo(view, 'change', this.onChangeItem);

View file

@ -101,7 +101,7 @@ define([
this.collection = this.getApplication().getCollection('Common.Collections.ReviewChanges'); this.collection = this.getApplication().getCollection('Common.Collections.ReviewChanges');
this.userCollection = this.getApplication().getCollection('Common.Collections.Users'); this.userCollection = this.getApplication().getCollection('Common.Collections.Users');
this._state = {posx: -1000, posy: -1000, popoverVisible: false, previewMode: false, compareSettings: null /*new AscCommon.CComparisonPr()*/}; this._state = {posx: -1000, posy: -1000, popoverVisible: false, previewMode: false, compareSettings: null, wsLock: false, wsProps: []};
Common.NotificationCenter.on('reviewchanges:turn', this.onTurnPreview.bind(this)); Common.NotificationCenter.on('reviewchanges:turn', this.onTurnPreview.bind(this));
Common.NotificationCenter.on('spelling:turn', this.onTurnSpelling.bind(this)); Common.NotificationCenter.on('spelling:turn', this.onTurnSpelling.bind(this));

View file

@ -341,5 +341,5 @@
} }
.combo-slicer-style { .combo-slicer-style {
.combo-textart(61px, 4px); .combo-textart(60px, 4px);
} }

View file

@ -235,7 +235,8 @@ define([
cls: 'combo-chart-style', cls: 'combo-chart-style',
dataHint: '1', dataHint: '1',
dataHintDirection: 'bottom', dataHintDirection: 'bottom',
dataHintOffset: 'big' dataHintOffset: 'big',
delayRenderTips: true
}); });
this.cmbWrapType.menuPicker.itemTemplate = this.cmbWrapType.fieldPicker.itemTemplate = _.template([ this.cmbWrapType.menuPicker.itemTemplate = this.cmbWrapType.fieldPicker.itemTemplate = _.template([
'<div class="item-icon-box" id="<%= id %>">', '<div class="item-icon-box" id="<%= id %>">',
@ -274,7 +275,8 @@ define([
restoreHeight: 465, restoreHeight: 465,
groups: new Common.UI.DataViewGroupStore(Common.define.chartData.getChartGroupData()), groups: new Common.UI.DataViewGroupStore(Common.define.chartData.getChartGroupData()),
store: new Common.UI.DataViewStore(Common.define.chartData.getChartData()), store: new Common.UI.DataViewStore(Common.define.chartData.getChartData()),
itemTemplate: _.template('<div id="<%= id %>" class="item-chartlist"><svg width="40" height="40" class=\"icon\"><use xlink:href=\"#chart-<%= iconCls %>\"></use></svg></div>') itemTemplate: _.template('<div id="<%= id %>" class="item-chartlist"><svg width="40" height="40" class=\"icon\"><use xlink:href=\"#chart-<%= iconCls %>\"></use></svg></div>'),
delayRenderTips: true
}); });
}); });
this.btnChartType.render($('#chart-button-type')); this.btnChartType.render($('#chart-button-type'));
@ -444,7 +446,8 @@ define([
cls: 'combo-chart-style', cls: 'combo-chart-style',
dataHint: '1', dataHint: '1',
dataHintDirection: 'bottom', dataHintDirection: 'bottom',
dataHintOffset: 'big' dataHintOffset: 'big',
delayRenderTips: true
}); });
this.cmbChartStyle.render($('#chart-combo-style')); this.cmbChartStyle.render($('#chart-combo-style'));
this.cmbChartStyle.openButton.menu.cmpEl.css({ this.cmbChartStyle.openButton.menu.cmpEl.css({

View file

@ -139,7 +139,8 @@ define([
cls: 'combo-chart-style', cls: 'combo-chart-style',
dataHint: '1', dataHint: '1',
dataHintDirection: 'bottom', dataHintDirection: 'bottom',
dataHintOffset: '-10, 0' dataHintOffset: '-10, 0',
delayRenderTips: true
}); });
this.cmbWrapType.menuPicker.itemTemplate = this.cmbWrapType.fieldPicker.itemTemplate = _.template([ this.cmbWrapType.menuPicker.itemTemplate = this.cmbWrapType.fieldPicker.itemTemplate = _.template([
'<div class="item-icon-box" id="<%= id %>" style="">', '<div class="item-icon-box" id="<%= id %>" style="">',

View file

@ -1586,7 +1586,8 @@ define([
cls: 'combo-chart-style', cls: 'combo-chart-style',
dataHint: '1', dataHint: '1',
dataHintDirection: 'bottom', dataHintDirection: 'bottom',
dataHintOffset: 'big' dataHintOffset: 'big',
delayRenderTips: true
}); });
this.cmbWrapType.menuPicker.itemTemplate = this.cmbWrapType.fieldPicker.itemTemplate = _.template([ this.cmbWrapType.menuPicker.itemTemplate = this.cmbWrapType.fieldPicker.itemTemplate = _.template([
'<div class="item-icon-box" id="<%= id %>">', '<div class="item-icon-box" id="<%= id %>">',

View file

@ -240,6 +240,8 @@ define([
createDelayedControls: function() { createDelayedControls: function() {
var me = this; var me = this;
this._tableTemplates && this._onInitTemplates(this._tableTemplates);
this.chHeader = new Common.UI.CheckBox({ this.chHeader = new Common.UI.CheckBox({
el: $('#table-checkbox-header'), el: $('#table-checkbox-header'),
labelText: this.textHeader, labelText: this.textHeader,
@ -729,6 +731,11 @@ define([
}, },
_onInitTemplates: function(Templates){ _onInitTemplates: function(Templates){
if (this._initSettings) {
this._tableTemplates = Templates;
return;
}
var self = this; var self = this;
this._isTemplatesChanged = true; this._isTemplatesChanged = true;
@ -754,7 +761,8 @@ define([
groups: new Common.UI.DataViewGroupStore(), groups: new Common.UI.DataViewGroupStore(),
store: new Common.UI.DataViewStore(), store: new Common.UI.DataViewStore(),
itemTemplate: _.template('<div id="<%= id %>" class="item"><img src="<%= imageUrl %>" height="52" width="72"></div>'), itemTemplate: _.template('<div id="<%= id %>" class="item"><img src="<%= imageUrl %>" height="52" width="72"></div>'),
style: 'max-height: 350px;' style: 'max-height: 350px;',
delayRenderTips: true
}); });
}); });
this.btnTableTemplate.render($('#table-btn-template')); this.btnTableTemplate.render($('#table-btn-template'));

View file

@ -226,7 +226,8 @@ define([
restoreHeight: 465, restoreHeight: 465,
groups: new Common.UI.DataViewGroupStore(Common.define.chartData.getChartGroupData()), groups: new Common.UI.DataViewGroupStore(Common.define.chartData.getChartGroupData()),
store: new Common.UI.DataViewStore(Common.define.chartData.getChartData()), store: new Common.UI.DataViewStore(Common.define.chartData.getChartData()),
itemTemplate: _.template('<div id="<%= id %>" class="item-chartlist"><svg width="40" height="40" class=\"icon\"><use xlink:href=\"#chart-<%= iconCls %>\"></use></svg></div>') itemTemplate: _.template('<div id="<%= id %>" class="item-chartlist"><svg width="40" height="40" class=\"icon\"><use xlink:href=\"#chart-<%= iconCls %>\"></use></svg></div>'),
delayRenderTips: true
}); });
}); });
this.btnChartType.render($('#chart-button-type')); this.btnChartType.render($('#chart-button-type'));
@ -386,7 +387,8 @@ define([
cls: 'combo-chart-style', cls: 'combo-chart-style',
dataHint: '1', dataHint: '1',
dataHintDirection: 'bottom', dataHintDirection: 'bottom',
dataHintOffset: 'big' dataHintOffset: 'big',
delayRenderTips: true
}); });
this.cmbChartStyle.render($('#chart-combo-style')); this.cmbChartStyle.render($('#chart-combo-style'));
this.cmbChartStyle.openButton.menu.cmpEl.css({ this.cmbChartStyle.openButton.menu.cmpEl.css({

View file

@ -227,6 +227,8 @@ define([
createDelayedControls: function() { createDelayedControls: function() {
var me = this; var me = this;
this._tableTemplates && this._onInitTemplates(this._tableTemplates);
this.chHeader = new Common.UI.CheckBox({ this.chHeader = new Common.UI.CheckBox({
el: $('#table-checkbox-header'), el: $('#table-checkbox-header'),
labelText: this.textHeader, labelText: this.textHeader,
@ -670,6 +672,11 @@ define([
}, },
_onInitTemplates: function(Templates){ _onInitTemplates: function(Templates){
if (this._initSettings) {
this._tableTemplates = Templates;
return;
}
var self = this; var self = this;
this._isTemplatesChanged = true; this._isTemplatesChanged = true;
@ -695,7 +702,8 @@ define([
groups: new Common.UI.DataViewGroupStore(), groups: new Common.UI.DataViewGroupStore(),
store: new Common.UI.DataViewStore(), store: new Common.UI.DataViewStore(),
itemTemplate: _.template('<div id="<%= id %>" class="item"><img src="<%= imageUrl %>" height="52" width="72"></div>'), itemTemplate: _.template('<div id="<%= id %>" class="item"><img src="<%= imageUrl %>" height="52" width="72"></div>'),
style: 'max-height: 350px;' style: 'max-height: 350px;',
delayRenderTips: true
}); });
}); });
this.btnTableTemplate.render($('#table-btn-template')); this.btnTableTemplate.render($('#table-btn-template'));

View file

@ -2021,7 +2021,8 @@ define([
restoreHeight: 300, restoreHeight: 300,
style: 'max-height: 300px;', style: 'max-height: 300px;',
store: me.getCollection('TableTemplates'), store: me.getCollection('TableTemplates'),
itemTemplate: _.template('<div class="item-template"><img src="<%= imageUrl %>" id="<%= id %>" style="width:60px;height:44px;"></div>') itemTemplate: _.template('<div class="item-template"><img src="<%= imageUrl %>" id="<%= id %>" style="width:60px;height:44px;"></div>'),
delayRenderTips: true
}); });
picker.on('item:click', function(picker, item, record) { picker.on('item:click', function(picker, item, record) {

View file

@ -135,6 +135,11 @@ define([
if (this._initSettings) if (this._initSettings)
this.createDelayedElements(); this.createDelayedElements();
if (this._isEditType) {
this._props = props;
return;
}
this.ShowHideElem(!!(props && props.asc_getChartProperties && props.asc_getChartProperties())); this.ShowHideElem(!!(props && props.asc_getChartProperties && props.asc_getChartProperties()));
this.disableControls(this._locked); this.disableControls(this._locked);
@ -680,7 +685,8 @@ define([
allowScrollbar: false, allowScrollbar: false,
groups: new Common.UI.DataViewGroupStore(Common.define.chartData.getSparkGroupData()), groups: new Common.UI.DataViewGroupStore(Common.define.chartData.getSparkGroupData()),
store: new Common.UI.DataViewStore(Common.define.chartData.getSparkData()), store: new Common.UI.DataViewStore(Common.define.chartData.getSparkData()),
itemTemplate: _.template('<div id="<%= id %>" class="item-chartlist"><svg width="40" height="40" class=\"icon\"><use xlink:href=\"#chart-<%= iconCls %>\"></use></svg></div>') itemTemplate: _.template('<div id="<%= id %>" class="item-chartlist"><svg width="40" height="40" class=\"icon\"><use xlink:href=\"#chart-<%= iconCls %>\"></use></svg></div>'),
delayRenderTips: true
}); });
}); });
this.btnSparkType.render($('#spark-button-type')); this.btnSparkType.render($('#spark-button-type'));
@ -950,12 +956,14 @@ define([
if (result == 'ok') { if (result == 'ok') {
props.endEdit(); props.endEdit();
me._isEditType = false; me._isEditType = false;
me._props && me.ChangeSettings(me._props);
} }
Common.NotificationCenter.trigger('edit:complete', me); Common.NotificationCenter.trigger('edit:complete', me);
} }
}).on('close', function() { }).on('close', function() {
me._isEditType && props.cancelEdit(); me._isEditType && props.cancelEdit();
me._isEditType = false; me._isEditType = false;
me._props = null;
}); });
win.show(); win.show();
} }
@ -994,7 +1002,8 @@ define([
cls: 'combo-chart-style', cls: 'combo-chart-style',
dataHint: '1', dataHint: '1',
dataHintDirection: 'bottom', dataHintDirection: 'bottom',
dataHintOffset: 'big' dataHintOffset: 'big',
delayRenderTips: true
}); });
this.cmbChartStyle.render($('#chart-combo-style')); this.cmbChartStyle.render($('#chart-combo-style'));
this.cmbChartStyle.openButton.menu.cmpEl.css({ this.cmbChartStyle.openButton.menu.cmpEl.css({
@ -1046,7 +1055,8 @@ define([
itemHeight: 50, itemHeight: 50,
menuMaxHeight: 272, menuMaxHeight: 272,
enableKeyEvents: true, enableKeyEvents: true,
cls: 'combo-spark-style' cls: 'combo-spark-style',
delayRenderTips: true
}); });
this.cmbSparkStyle.render($('#spark-combo-style')); this.cmbSparkStyle.render($('#spark-combo-style'));
this.cmbSparkStyle.openButton.menu.cmpEl.css({ this.cmbSparkStyle.openButton.menu.cmpEl.css({

View file

@ -178,7 +178,8 @@ define([
'<span class="title"><%= title %></span>', '<span class="title"><%= title %></span>',
'<% } %>', '<% } %>',
'</div>' '</div>'
].join('')) ].join('')),
delayRenderTips: true
}); });
this.stylesList.on('item:select', _.bind(this.onSelectStyles, this)); this.stylesList.on('item:select', _.bind(this.onSelectStyles, this));

View file

@ -692,7 +692,7 @@ define([
if (!this.btnSlicerStyle) { if (!this.btnSlicerStyle) {
this.btnSlicerStyle = new Common.UI.ComboDataView({ this.btnSlicerStyle = new Common.UI.ComboDataView({
itemWidth: 36, itemWidth: 36,
itemHeight: 49, itemHeight: 48,
menuMaxHeight: 235, menuMaxHeight: 235,
enableKeyEvents: true, enableKeyEvents: true,
cls: 'combo-slicer-style', cls: 'combo-slicer-style',

View file

@ -531,7 +531,8 @@ define([
groups: new Common.UI.DataViewGroupStore(), groups: new Common.UI.DataViewGroupStore(),
store: new Common.UI.DataViewStore(), store: new Common.UI.DataViewStore(),
itemTemplate: _.template('<div id="<%= id %>" class="item"><img src="<%= imageUrl %>" height="44" width="60"></div>'), itemTemplate: _.template('<div id="<%= id %>" class="item"><img src="<%= imageUrl %>" height="44" width="60"></div>'),
style: 'max-height: 325px;' style: 'max-height: 325px;',
delayRenderTips: true
}); });
}); });
this.btnTableTemplate.render($('#table-btn-template')); this.btnTableTemplate.render($('#table-btn-template'));

View file

@ -83,7 +83,8 @@
} }
.pivot-check-listview { .pivot-check-listview {
background-color: #fff; background-color: @background-normal-ie;
background-color: @background-normal;
width: 100%; width: 100%;
height: 250px; height: 250px;
@ -111,7 +112,8 @@
} }
.pivot-listview { .pivot-listview {
background-color: #fff; background-color: @background-normal-ie;
background-color: @background-normal;
width: 95px; width: 95px;
height: 130px; height: 130px;