(DE advanced settings without button apply)
This commit is contained in:
Julia Radzhabova 2022-03-05 15:28:22 +03:00
parent f9571ab875
commit 0137bb22a4
3 changed files with 15 additions and 23 deletions

View file

@ -433,7 +433,7 @@ define([
this.isFromFileDownloadAs = false;
},
applySettings: function(menu, showmenu) {
applySettings: function(menu) {
var value;
value = Common.localStorage.getBool("de-settings-inputmode");
@ -502,7 +502,7 @@ define([
this.api.put_ShowSnapLines(Common.Utils.InternalSettings.get("de-settings-showsnaplines"));
(!showmenu) && menu.hide();
menu.hide();
},
onCreateNew: function(menu, type) {

View file

@ -69,10 +69,7 @@ define([
this.fireEvent('item:click', [this, item.options.action, !!panel]);
if (panel) {
if(this.active == 'opts')
this.panels[this.active].hide();
else
this.$el.find('.content-box:visible').hide();
this.$el.find('.content-box:visible').hide();
this.active = item.options.action;
panel.show();
}

View file

@ -355,21 +355,21 @@ define([
'<div><div id="fms-cmb-macros" style="display: inline-block; margin-right: 15px; vertical-align: middle;"></div>',
'</tr>',
'<tr class ="divider-group"></tr>',
/*'<tr class="fms-btn-apply">',
'<tr class="fms-btn-apply">',
'<td style="padding-top:15px; padding-bottom: 15px;"><button class="btn normal dlg-btn primary" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium"><%= scope.okButtonText %></button></td>',
'<td></td>',
'</tr>',*/
'</tr>',
'</tbody></table>',
'</div>',
/* '<div class="fms-flex-apply hidden">',
'<div class="fms-flex-apply hidden">',
'<table style="margin: 10px 14px;"><tbody>',
'<tr>',
'<td><button class="btn normal dlg-btn primary" data-hint="2" data-hint-direction="bottom" data-hint-offset="big"><%= scope.okButtonText %></button></td>',
'<td></td>',
'</tr>',
'</tbody></table>',
'</div>'*/
'</div>'
].join('')),
initialize: function(options) {
@ -652,17 +652,16 @@ define([
dataHintDirection: 'left',
dataHintOffset: 'small'
});
this.menu.on('menu:hide', _.bind(this.applySettings,this));
/*$markup.find('.btn.primary').each(function(index, el){
$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.pnlApply = $markup.find('.fms-flex-apply').addBack().filter('.fms-flex-apply');
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.trApply = $markup.find('.fms-btn-apply');
this.$el = $(node).html($markup);
@ -689,17 +688,13 @@ define([
this.updateSettings();
this.updateScroller();
},
hide: function (){
Common.UI.BaseView.prototype.hide.call(this,arguments);
this.applySettings();
},
updateScroller: function() {
if (this.scroller) {
Common.UI.Menu.Manager.hideAll();
var scrolled = this.$el.height()< this.pnlTable.parent().height() + 25;// + this.pnlApply.height();
//this.pnlApply.toggleClass('hidden', !scrolled);
//this.trApply.toggleClass('hidden', scrolled);
var scrolled = this.$el.height()< this.pnlTable.parent().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.pnlSettings.toggleClass('bordered', this.scroller.isVisible());
@ -861,7 +856,7 @@ define([
Common.localStorage.save();
if (this.menu) {
this.menu.fireEvent('settings:apply', [this.menu, true]);
this.menu.fireEvent('settings:apply', [this.menu]);
if (this._oldUnits !== this.cmbUnit.getValue())
Common.NotificationCenter.trigger('settings:unitschanged', this);