fixed combo styles

This commit is contained in:
nikita_bartoshuk
2025-11-28 18:08:08 +03:00
parent 90ec94f6ee
commit 79eeb8172b
4 changed files with 30 additions and 14 deletions

View File

@ -456,8 +456,13 @@
padding: 1px;
}
.dataview.inner {
padding: 1px 14px 1px 0px;
}
.dropdown-menu {
padding: 1px 1px 5px 1px;
padding: 0px 0px 5px 0px;
margin-left: 2px;
.dataview {
.group-description {

View File

@ -83,7 +83,7 @@ define([
'</div>' +
'</div>' +
'<div class="separator long"></div>' +
'<div class="group flex small" id="slot-field-chart-styles" style="width: 100%; min-width: 105px;" data-group-width="100%">' +
'<div class="group flex small" id="slot-field-chart-styles" style="width: 100%; min-width: 100px;" data-group-width="100%">' +
'</div>' +
'<div class="separator long separator-chart-styles"></div>' +
'<div class="group">' +
@ -527,7 +527,6 @@ define([
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small',
menu: true,
menu: this.menuChartElement.menu
});
this.lockedControls.push(this.btnChartElements);
@ -567,7 +566,7 @@ define([
this.chartStyles = new Common.UI.ComboDataView({
cls : 'combo-chart-template',
style : 'min-width: 103px; max-width: 497px;',
style : 'min-width: 90px; max-width: 496px;',
enableKeyEvents : true,
itemWidth : 50,
itemHeight : 50,
@ -578,7 +577,7 @@ define([
beforeOpenHandler: function(e) {
var cmp = this,
menu = cmp.openButton.menu,
columnCount = 8;
minMenuColumn = 4;
if (menu.cmpEl) {
var itemEl = $(cmp.cmpEl.find('.dataview.inner .style').get(0)).parent();
@ -586,13 +585,17 @@ define([
var itemWidth = itemEl.is(':visible') ? parseFloat(itemEl.css('width')) :
(cmp.itemWidth + parseFloat(itemEl.css('padding-left')) + parseFloat(itemEl.css('padding-right')) +
parseFloat(itemEl.css('border-left-width')) + parseFloat(itemEl.css('border-right-width')));
var minCount = cmp.menuPicker.store.length >= minMenuColumn ? minMenuColumn : cmp.menuPicker.store.length,
columnCount = Math.min(cmp.menuPicker.store.length, Math.round($('.dataview', $(cmp.fieldPicker.el)).width() / (itemMargin + itemWidth)));
columnCount = columnCount < minCount ? minCount : columnCount;
menu.menuAlignEl = cmp.cmpEl;
menu.menuAlign = 'tl-tl';
var menuWidth = columnCount * (itemMargin + itemWidth) + 14, // for scroller
var menuWidth = columnCount * (itemMargin + itemWidth) + 16, // for scroller
buttonOffsetLeft = Common.Utils.getOffset(cmp.openButton.$el).left;
if (menuWidth>Common.Utils.innerWidth())
menuWidth = Math.max(Math.floor((Common.Utils.innerWidth()-14)/(itemMargin + itemWidth)), 2) * (itemMargin + itemWidth) - 14;
var offset = cmp.cmpEl.width() - cmp.openButton.$el.width() - Math.min(menuWidth, buttonOffsetLeft) - 1;
menuWidth = Math.max(Math.floor((Common.Utils.innerWidth()-16)/(itemMargin + itemWidth)), 2) * (itemMargin + itemWidth) + 16;
var offset = cmp.cmpEl.width() - cmp.openButton.$el.width() - Math.min(menuWidth, buttonOffsetLeft);
if (Common.UI.isRTL()) {
offset = cmp.openButton.$el.width() + parseFloat($(cmp.$el.find('.combo-dataview').get(0)).css('padding-left'));
}

View File

@ -259,6 +259,9 @@ define([], function () {
this.chRightAngle.on('change', _.bind(function(field, newValue, oldValue, eOpts) {
if (this.api && this.chartProps && this.oView3D) {
this.oView3D.asc_setRightAngleAxes(field.getValue()=='checked');
this.spnPerspective.setDisabled(field.getValue()=='checked');
this.btnNarrow.setDisabled(field.getValue()=='checked');
this.btnWiden.setDisabled(field.getValue()=='checked');
}
}, this));
@ -269,6 +272,7 @@ define([], function () {
this.chAutoscale.on('change', _.bind(function(field, newValue, oldValue, eOpts) {
if (this.api && this.chartProps && this.oView3D){
this.oView3D.asc_setHeight(field.getValue()=='checked' ? null : this.spn3DHeight.getNumberValue());
this.spn3DHeight.setDisabled(field.getValue()=='checked');
}
}, this));

View File

@ -82,7 +82,7 @@ define([
'<div class="group">' +
'<span class="btn-slot text x-huge" id="slot-btn-sparkline-marker-color"></span>' +
'</div>' +
'<div class="group flex small" id="id-spark-combo-style" style="width: 100%; min-width: 105px;" data-group-width="100%"></div>' +
'<div class="group flex small" id="id-spark-combo-style" style="width: 100%; min-width: 100px;" data-group-width="100%"></div>' +
'<div class="group small">' +
'<div class="elset">' +
'<span class="btn-slot text" id="slot-btn-sparkline-color"></span>' +
@ -279,13 +279,13 @@ define([
lock: [_set.lostConnect, _set.coAuth, _set.editCell, _set.sparkLocked, _set.wsLock,],
enableKeyEvents: true,
cls: 'combo-chart-template',
style: 'min-width: 103px; max-width: 497px;',
style: 'min-width: 90px; max-width: 496px;',
delayRenderTips: true,
autoWidth: true,
beforeOpenHandler: function(e) {
var cmp = this,
menu = cmp.openButton.menu,
columnCount = 8;
minMenuColumn = 6;
if (menu.cmpEl) {
var itemEl = $(cmp.cmpEl.find('.dataview.inner .style').get(0)).parent();
@ -293,13 +293,17 @@ define([
var itemWidth = itemEl.is(':visible') ? parseFloat(itemEl.css('width')) :
(cmp.itemWidth + parseFloat(itemEl.css('padding-left')) + parseFloat(itemEl.css('padding-right')) +
parseFloat(itemEl.css('border-left-width')) + parseFloat(itemEl.css('border-right-width')));
var minCount = cmp.menuPicker.store.length >= minMenuColumn ? minMenuColumn : cmp.menuPicker.store.length,
columnCount = Math.min(cmp.menuPicker.store.length, Math.round($('.dataview', $(cmp.fieldPicker.el)).width() / (itemMargin + itemWidth)));
columnCount = columnCount < minCount ? minCount : columnCount;
menu.menuAlignEl = cmp.cmpEl;
menu.menuAlign = 'tl-tl';
var menuWidth = columnCount * (itemMargin + itemWidth) + 14, // for scroller
var menuWidth = columnCount * (itemMargin + itemWidth) + 16, // for scroller
buttonOffsetLeft = Common.Utils.getOffset(cmp.openButton.$el).left;
if (menuWidth>Common.Utils.innerWidth())
menuWidth = Math.max(Math.floor((Common.Utils.innerWidth()-14)/(itemMargin + itemWidth)), 2) * (itemMargin + itemWidth) - 14;
var offset = cmp.cmpEl.width() - cmp.openButton.$el.width() - Math.min(menuWidth, buttonOffsetLeft) - 1;
menuWidth = Math.max(Math.floor((Common.Utils.innerWidth()-16)/(itemMargin + itemWidth)), 2) * (itemMargin + itemWidth) + 16;
var offset = cmp.cmpEl.width() - cmp.openButton.$el.width() - Math.min(menuWidth, buttonOffsetLeft);
if (Common.UI.isRTL()) {
offset = cmp.openButton.$el.width() + parseFloat($(cmp.$el.find('.combo-dataview').get(0)).css('padding-left'));
}