Commit 5f631382 authored by Julia Radzhabova's avatar Julia Radzhabova

Bug 32028: при первом открытии редакторов показывать правую панель с...

Bug 32028: при первом открытии редакторов показывать правую панель с настройками + при следующих загрузках учитывать, закрыл ли юзер панель самостоятельно (кликом по кнопке в правом меню).
parent 13837073
......@@ -72,7 +72,7 @@ define([
this.rightmenu.fireEvent('editcomplete', this.rightmenu);
},
onFocusObject: function(SelectedObjects) {
onFocusObject: function(SelectedObjects, open) {
if (!this.editMode)
return;
......@@ -158,7 +158,7 @@ define([
if (!this._settings[Common.Utils.documentSettingsType.MailMerge].hidden)
this._settings[Common.Utils.documentSettingsType.MailMerge].panel.setLocked(this._settings[Common.Utils.documentSettingsType.MailMerge].locked);
if (!this.rightmenu.minimizedMode) {
if (!this.rightmenu.minimizedMode || open) {
var active;
if (priorityactive>-1) active = priorityactive;
......@@ -166,8 +166,11 @@ define([
else if (currentactive>=0) active = currentactive;
else if (!this._settings[Common.Utils.documentSettingsType.MailMerge].hidden) active = Common.Utils.documentSettingsType.MailMerge;
if (active == undefined && open && lastactive>=0)
active = lastactive;
if (active !== undefined) {
this.rightmenu.SetActivePane(active);
this.rightmenu.SetActivePane(active, open);
if (active!=Common.Utils.documentSettingsType.MailMerge)
this._settings[active].panel.ChangeSettings.call(this._settings[active].panel, this._settings[active].props);
else
......@@ -237,8 +240,12 @@ define([
if (this.editMode && this.api) {
var selectedElements = this.api.getSelectedElements();
if (selectedElements.length>0)
this.onFocusObject(selectedElements);
if (selectedElements.length>0) {
var open = Common.localStorage.getItem("de-hide-right-settings");
open = (open===null || parseInt(open) == 0);
this.onFocusObject(selectedElements, open);
}
}
},
......
......@@ -194,7 +194,7 @@ define([
$(this.el).width(MENU_SCALE_PART);
target_pane_parent.css("display", "inline-block" );
this.minimizedMode = false;
Common.localStorage.setItem("de-hidden-right-settings", 0);
Common.localStorage.setItem("de-hide-right-settings", 0);
}
target_pane_parent.find('> .active').removeClass('active');
target_pane.addClass("active");
......@@ -206,7 +206,7 @@ define([
target_pane_parent.css("display", "none" );
$(this.el).width(SCALE_MIN);
this.minimizedMode = true;
Common.localStorage.setItem("de-hidden-right-settings", 1);
Common.localStorage.setItem("de-hide-right-settings", 1);
}
this.fireEvent('rightmenuclick', [this, btn.options.asctype, this.minimizedMode]);
......@@ -248,7 +248,6 @@ define([
target_pane.css("display", "none" );
$(this.el).width(SCALE_MIN);
this.minimizedMode = true;
Common.localStorage.setItem("de-hidden-right-settings", 1);
Common.NotificationCenter.trigger('layout:changed', 'rightmenu');
},
......
......@@ -71,7 +71,7 @@ define([
this.rightmenu.fireEvent('editcomplete', this.rightmenu);
},
onFocusObject: function(SelectedObjects) {
onFocusObject: function(SelectedObjects, open) {
if (!this.editMode)
return;
......@@ -147,7 +147,7 @@ define([
}
}
if (!this.rightmenu.minimizedMode) {
if (!this.rightmenu.minimizedMode || open) {
var active;
if (priorityactive>-1) active = priorityactive;
......@@ -156,7 +156,7 @@ define([
else active = Common.Utils.documentSettingsType.Slide;
if (active !== undefined) {
this.rightmenu.SetActivePane(active);
this.rightmenu.SetActivePane(active, open);
this._settings[active].panel.ChangeSettings.call(this._settings[active].panel, this._settings[active].props);
}
}
......@@ -214,8 +214,12 @@ define([
this.api.asc_registerCallback('asc_doubleClickOnObject', _.bind(this.onDoubleClickOnObject, this));
var selectedElements = this.api.getSelectedElements();
if (selectedElements.length>0)
this.onFocusObject(selectedElements);
if (selectedElements.length>0) {
var open = Common.localStorage.getItem("pe-hide-right-settings");
open = (open===null || parseInt(open) == 0);
this.onFocusObject(selectedElements, open);
}
}
},
......
......@@ -176,7 +176,7 @@ define([
$(this.el).width(MENU_SCALE_PART);
target_pane_parent.css("display", "inline-block" );
this.minimizedMode = false;
Common.localStorage.setItem("pe-hidden-right-settings", 0);
Common.localStorage.setItem("pe-hide-right-settings", 0);
}
target_pane_parent.find('> .active').removeClass('active');
target_pane.addClass("active");
......@@ -189,7 +189,7 @@ define([
target_pane_parent.css("display", "none" );
$(this.el).width(SCALE_MIN);
this.minimizedMode = true;
Common.localStorage.setItem("pe-hidden-right-settings", 1);
Common.localStorage.setItem("pe-hide-right-settings", 1);
}
this.fireEvent('rightmenuclick', [this, btn.options.asctype, this.minimizedMode]);
......@@ -245,7 +245,6 @@ define([
target_pane.css("display", "none" );
$(this.el).width(SCALE_MIN);
this.minimizedMode = true;
Common.localStorage.setItem("pe-hidden-right-settings", 1);
Common.NotificationCenter.trigger('layout:changed', 'rightmenu');
},
......
......@@ -156,16 +156,20 @@ define([
}
}
if (!this.rightmenu.minimizedMode) {
if (!this.rightmenu.minimizedMode || this._openRightMenu) {
var active;
if (priorityactive>-1) active = priorityactive;
else if (lastactive>=0 && currentactive<0) active = lastactive;
else if (currentactive>=0) active = currentactive;
if (active == undefined && this._openRightMenu && lastactive>=0)
active = lastactive;
if (active !== undefined) {
this.rightmenu.SetActivePane(active);
this.rightmenu.SetActivePane(active, this._openRightMenu);
this._settings[active].panel.ChangeSettings.call(this._settings[active].panel, this._settings[active].props);
this._openRightMenu = false;
}
}
......@@ -213,6 +217,9 @@ define([
createDelayedElements: function() {
var me = this;
if (this.api) {
var open = Common.localStorage.getItem("sse-hide-right-settings");
this._openRightMenu = (open===null || parseInt(open) == 0);
this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onFocusObject, this));
this.api.asc_registerCallback('asc_onSelectionChanged', _.bind(this.onSelectionChanged, this));
this.api.asc_registerCallback('asc_doubleClickOnObject', _.bind(this.onDoubleClickOnObject, this));
......
......@@ -150,7 +150,7 @@ define([
$(this.el).width(MENU_SCALE_PART);
target_pane_parent.css("display", "inline-block" );
this.minimizedMode = false;
Common.localStorage.setItem("sse-hidden-right-settings", 0);
Common.localStorage.setItem("sse-hide-right-settings", 0);
}
target_pane_parent.find('> .active').removeClass('active');
target_pane.addClass("active");
......@@ -162,7 +162,7 @@ define([
target_pane_parent.css("display", "none" );
$(this.el).width(SCALE_MIN);
this.minimizedMode = true;
Common.localStorage.setItem("sse-hidden-right-settings", 1);
Common.localStorage.setItem("sse-hide-right-settings", 1);
}
this.fireEvent('rightmenuclick', [this, btn.options.asctype, this.minimizedMode]);
......@@ -216,7 +216,6 @@ define([
target_pane.css("display", "none" );
$(this.el).width(SCALE_MIN);
this.minimizedMode = true;
Common.localStorage.setItem("sse-hidden-right-settings", 1);
Common.NotificationCenter.trigger('layout:changed', 'rightmenu');
},
......
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