Fix Bug 47479

This commit is contained in:
Julia Radzhabova 2020-11-18 00:38:48 +03:00
parent d98a8ef05f
commit 26752c4c5c
5 changed files with 66 additions and 19 deletions

View file

@ -302,6 +302,9 @@ define([
if ($list.hasClass('menu-absolute')) { if ($list.hasClass('menu-absolute')) {
var offset = this.cmpEl.offset(); var offset = this.cmpEl.offset();
$list.css({left: offset.left, top: offset.top + this.cmpEl.outerHeight() + 2}); $list.css({left: offset.left, top: offset.top + this.cmpEl.outerHeight() + 2});
} else if ($list.hasClass('menu-aligned')) {
var offset = this.cmpEl.offset();
$list.toggleClass('show-top', offset.top + this.cmpEl.outerHeight() + $list.outerHeight() > Common.Utils.innerHeight());
} }
}, },

View file

@ -130,6 +130,11 @@
.dropdown-menu.menu-absolute { .dropdown-menu.menu-absolute {
position: fixed; position: fixed;
} }
.dropdown-menu.show-top {
top: auto;
bottom: 100%;
}
} }
.open > .combobox.combo-dataview-menu { .open > .combobox.combo-dataview-menu {

View file

@ -262,13 +262,17 @@ define([
'<div><div id="fms-cmb-macros" style="display: inline-block; margin-right: 15px;vertical-align: middle;"></div>', '<div><div id="fms-cmb-macros" style="display: inline-block; margin-right: 15px;vertical-align: middle;"></div>',
'<label id="fms-lbl-macros" style="vertical-align: middle;"><%= scope.txtWarnMacrosDesc %></label></div></td>', '<label id="fms-lbl-macros" style="vertical-align: middle;"><%= scope.txtWarnMacrosDesc %></label></div></td>',
'</tr>','<tr class="divider macros"></tr>', '</tr>','<tr class="divider macros"></tr>',
'<tr class="fms-btn-apply">',
'<td class="left"></td>',
'<td class="right" style="padding-top:15px; padding-bottom: 15px;"><button class="btn normal dlg-btn primary"><%= scope.okButtonText %></button></td>',
'</tr>',
'</tbody></table>', '</tbody></table>',
'</div>', '</div>',
'<div>', '<div class="fms-flex-apply hidden">',
'<table style="margin: 10px 0;"><tbody>', '<table style="margin: 10px 0;"><tbody>',
'<tr>', '<tr>',
'<td class="left"></td>', '<td class="left"></td>',
'<td class="right"><button id="fms-btn-apply" class="btn normal dlg-btn primary"><%= scope.okButtonText %></button></td>', '<td class="right"><button class="btn normal dlg-btn primary"><%= scope.okButtonText %></button></td>',
'</tr>', '</tr>',
'</tbody></table>', '</tbody></table>',
'</div>' '</div>'
@ -425,6 +429,7 @@ define([
el : $markup.findById('#fms-cmb-macros'), el : $markup.findById('#fms-cmb-macros'),
style : 'width: 160px;', style : 'width: 160px;',
editable : false, editable : false,
menuCls : 'menu-aligned',
cls : 'input-group-nr', cls : 'input-group-nr',
data : [ data : [
{ value: 2, displayValue: this.txtStopMacros, descValue: this.txtStopMacrosDesc }, { value: 2, displayValue: this.txtStopMacros, descValue: this.txtStopMacrosDesc },
@ -446,13 +451,16 @@ define([
}); });
this.btnAutoCorrect.on('click', _.bind(this.autoCorrect, this)); this.btnAutoCorrect.on('click', _.bind(this.autoCorrect, this));
this.btnApply = new Common.UI.Button({ $markup.find('.btn.primary').each(function(index, el){
el: $markup.findById('#fms-btn-apply') (new Common.UI.Button({
el: $(el)
})).on('click', _.bind(me.applySettings, me));
}); });
this.btnApply.on('click', this.applySettings.bind(this));
this.pnlSettings = $markup.find('.flex-settings').addBack().filter('.flex-settings'); this.pnlSettings = $markup.find('.flex-settings').addBack().filter('.flex-settings');
this.pnlApply = $markup.find('.fms-flex-apply').addBack().filter('.fms-flex-apply');
this.pnlTable = this.pnlSettings.find('table');
this.trApply = $markup.find('.fms-btn-apply');
this.$el = $(node).html($markup); this.$el = $(node).html($markup);
@ -482,6 +490,11 @@ define([
updateScroller: function() { updateScroller: function() {
if (this.scroller) { if (this.scroller) {
Common.UI.Menu.Manager.hideAll();
var scrolled = this.$el.height()< this.pnlTable.height() + 25 + this.pnlApply.height();
this.pnlApply.toggleClass('hidden', !scrolled);
this.trApply.toggleClass('hidden', scrolled);
this.pnlSettings.css('overflow', scrolled ? 'hidden' : 'visible');
this.scroller.update(); this.scroller.update();
this.pnlSettings.toggleClass('bordered', this.scroller.isVisible()); this.pnlSettings.toggleClass('bordered', this.scroller.isVisible());
} }

View file

@ -236,13 +236,17 @@ define([
'<div><div id="fms-cmb-macros" style="display: inline-block; margin-right: 15px;vertical-align: middle;"></div>', '<div><div id="fms-cmb-macros" style="display: inline-block; margin-right: 15px;vertical-align: middle;"></div>',
'<label id="fms-lbl-macros" style="vertical-align: middle;"><%= scope.txtWarnMacrosDesc %></label></div></td>', '<label id="fms-lbl-macros" style="vertical-align: middle;"><%= scope.txtWarnMacrosDesc %></label></div></td>',
'</tr>','<tr class="divider macros"></tr>', '</tr>','<tr class="divider macros"></tr>',
'<tr class="fms-btn-apply">',
'<td class="left"></td>',
'<td class="right" style="padding-top:15px; padding-bottom: 15px;"><button class="btn normal dlg-btn primary"><%= scope.okButtonText %></button></td>',
'</tr>',
'</tbody></table>', '</tbody></table>',
'</div>', '</div>',
'<div>', '<div class="fms-flex-apply hidden">',
'<table style="margin: 10px 0;"><tbody>', '<table style="margin: 10px 0;"><tbody>',
'<tr>', '<tr>',
'<td class="left"></td>', '<td class="left"></td>',
'<td class="right"><button id="fms-btn-apply" class="btn normal dlg-btn primary"><%= scope.okButtonText %></button></td>', '<td class="right"><button class="btn normal dlg-btn primary"><%= scope.okButtonText %></button></td>',
'</tr>', '</tr>',
'</tbody></table>', '</tbody></table>',
'</div>' '</div>'
@ -368,6 +372,7 @@ define([
el : $markup.findById('#fms-cmb-macros'), el : $markup.findById('#fms-cmb-macros'),
style : 'width: 160px;', style : 'width: 160px;',
editable : false, editable : false,
menuCls : 'menu-aligned',
cls : 'input-group-nr', cls : 'input-group-nr',
data : [ data : [
{ value: 2, displayValue: this.txtStopMacros, descValue: this.txtStopMacrosDesc }, { value: 2, displayValue: this.txtStopMacros, descValue: this.txtStopMacrosDesc },
@ -389,13 +394,16 @@ define([
}); });
this.btnAutoCorrect.on('click', _.bind(this.autoCorrect, this)); this.btnAutoCorrect.on('click', _.bind(this.autoCorrect, this));
this.btnApply = new Common.UI.Button({ $markup.find('.btn.primary').each(function(index, el){
el: $markup.findById('#fms-btn-apply') (new Common.UI.Button({
el: $(el)
})).on('click', _.bind(me.applySettings, me));
}); });
this.btnApply.on('click', _.bind(this.applySettings, this));
this.pnlSettings = $markup.find('.flex-settings').addBack().filter('.flex-settings'); this.pnlSettings = $markup.find('.flex-settings').addBack().filter('.flex-settings');
this.pnlApply = $markup.find('.fms-flex-apply').addBack().filter('.fms-flex-apply');
this.pnlTable = this.pnlSettings.find('table');
this.trApply = $markup.find('.fms-btn-apply');
this.$el = $(node).html($markup); this.$el = $(node).html($markup);
@ -425,6 +433,11 @@ define([
updateScroller: function() { updateScroller: function() {
if (this.scroller) { if (this.scroller) {
Common.UI.Menu.Manager.hideAll();
var scrolled = this.$el.height()< this.pnlTable.height() + 25 + this.pnlApply.height();
this.pnlApply.toggleClass('hidden', !scrolled);
this.trApply.toggleClass('hidden', scrolled);
this.pnlSettings.css('overflow', scrolled ? 'hidden' : 'visible');
this.scroller.update(); this.scroller.update();
this.pnlSettings.toggleClass('bordered', this.scroller.isVisible()); this.pnlSettings.toggleClass('bordered', this.scroller.isVisible());
} }

View file

@ -737,13 +737,17 @@ define([
'<div><div id="fms-cmb-macros" style="display: inline-block; margin-right: 15px;vertical-align: middle;"></div>', '<div><div id="fms-cmb-macros" style="display: inline-block; margin-right: 15px;vertical-align: middle;"></div>',
'<label id="fms-lbl-macros" style="vertical-align: middle;"><%= scope.txtWarnMacrosDesc %></label></div></td>', '<label id="fms-lbl-macros" style="vertical-align: middle;"><%= scope.txtWarnMacrosDesc %></label></div></td>',
'</tr>','<tr class="divider macros"></tr>', '</tr>','<tr class="divider macros"></tr>',
'<tr class="fms-btn-apply">',
'<td class="left"></td>',
'<td class="right" style="padding-top:15px; padding-bottom: 15px;"><button class="btn normal dlg-btn primary"><%= scope.okButtonText %></button></td>',
'</tr>',
'</tbody></table>', '</tbody></table>',
'</div>', '</div>',
'<div>', '<div class="fms-flex-apply hidden">',
'<table class="main" style="margin: 10px 0;"><tbody>', '<table class="main" style="margin: 10px 0;"><tbody>',
'<tr>', '<tr>',
'<td class="left"></td>', '<td class="left"></td>',
'<td class="right"><button id="fms-btn-apply" class="btn normal dlg-btn primary"><%= scope.okButtonText %></button></td>', '<td class="right"><button class="btn normal dlg-btn primary"><%= scope.okButtonText %></button></td>',
'</tr>', '</tr>',
'</tbody></table>', '</tbody></table>',
'</div>', '</div>',
@ -977,6 +981,7 @@ define([
el : $markup.findById('#fms-cmb-macros'), el : $markup.findById('#fms-cmb-macros'),
style : 'width: 160px;', style : 'width: 160px;',
editable : false, editable : false,
menuCls : 'menu-aligned',
cls : 'input-group-nr', cls : 'input-group-nr',
data : [ data : [
{ value: 2, displayValue: this.txtStopMacros, descValue: this.txtStopMacrosDesc }, { value: 2, displayValue: this.txtStopMacros, descValue: this.txtStopMacrosDesc },
@ -992,13 +997,16 @@ define([
el: $markup.findById('#fms-chb-paste-settings'), el: $markup.findById('#fms-chb-paste-settings'),
labelText: this.strPasteButton labelText: this.strPasteButton
}); });
this.btnApply = new Common.UI.Button({
el: $markup.findById('#fms-btn-apply')
});
this.btnApply.on('click', _.bind(this.applySettings, this));
$markup.find('.btn.primary').each(function(index, el){
(new Common.UI.Button({
el: $(el)
})).on('click', _.bind(me.applySettings, me));
});
this.pnlSettings = $markup.find('.flex-settings').addBack().filter('.flex-settings'); this.pnlSettings = $markup.find('.flex-settings').addBack().filter('.flex-settings');
this.pnlApply = $markup.find('.fms-flex-apply').addBack().filter('.fms-flex-apply');
this.pnlTable = this.pnlSettings.find('table');
this.trApply = $markup.find('.fms-btn-apply');
this.$el = $(node).html($markup); this.$el = $(node).html($markup);
@ -1032,6 +1040,11 @@ define([
updateScroller: function() { updateScroller: function() {
if (this.scroller) { if (this.scroller) {
Common.UI.Menu.Manager.hideAll();
var scrolled = this.$el.height()< this.pnlTable.height() + 25 + this.pnlApply.height();
this.pnlApply.toggleClass('hidden', !scrolled);
this.trApply.toggleClass('hidden', scrolled);
this.pnlSettings.css('overflow', scrolled ? 'hidden' : 'visible');
this.scroller.update(); this.scroller.update();
this.pnlSettings.toggleClass('bordered', this.scroller.isVisible()); this.pnlSettings.toggleClass('bordered', this.scroller.isVisible());
} }