Commit bfc91dc9 authored by Julia Radzhabova's avatar Julia Radzhabova

[DE] Optimization of right panel.

parent 5aa30fba
......@@ -167,14 +167,15 @@ define([
this._settings[Common.Utils.documentSettingsType.MailMerge].locked = !can_add_table || in_equation;
}
var lastactive = -1, currentactive, priorityactive = -1;
var lastactive = -1, currentactive, priorityactive = -1,
activePane = this.rightmenu.GetActivePane();
for (i=0; i<this._settings.length; i++) {
var pnl = this._settings[i];
if (pnl===undefined || pnl.btn===undefined || pnl.panel===undefined) continue;
if ( pnl.hidden ) {
if (!pnl.btn.isDisabled()) pnl.btn.setDisabled(true);
if (this.rightmenu.GetActivePane() == pnl.panelId)
if (activePane == pnl.panelId)
currentactive = -1;
} else {
if (pnl.btn.isDisabled()) pnl.btn.setDisabled(false);
......@@ -182,7 +183,7 @@ define([
if ( pnl.needShow ) {
pnl.needShow = false;
priorityactive = i;
} else if (this.rightmenu.GetActivePane() == pnl.panelId)
} else if (activePane == pnl.panelId)
currentactive = i;
pnl.panel.setLocked(pnl.locked);
}
......
......@@ -258,7 +258,7 @@ define([
this._settings[type].btn.toggle(true, false);
this._settings[type].btn.trigger('click', this._settings[type].btn);
} else {
var target_pane = $("#" + this._settings[type].panel );
var target_pane = this.$el.find("#" + this._settings[type].panel );
if ( !target_pane.hasClass('active') ) {
target_pane.parent().find('> .active').removeClass('active');
target_pane.addClass("active");
......@@ -271,7 +271,7 @@ define([
},
GetActivePane: function() {
return (this.minimizedMode) ? null : $(".settings-panel.active")[0].id;
return (this.minimizedMode) ? null : this.$el.find(".settings-panel.active")[0].id;
},
clearSelection: function() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment