[PE] Fix Bug 35682

This commit is contained in:
Julia Radzhabova 2019-03-27 16:03:16 +03:00
parent 64072feb72
commit 56967e2302
2 changed files with 35 additions and 14 deletions

View file

@ -506,7 +506,7 @@ define([
if (panel == 'thumbs') { if (panel == 'thumbs') {
this.isThumbsShown = show; this.isThumbsShown = show;
} else { } else {
if (!show && this.isThumbsShown) { if (!show && this.isThumbsShown && !this.leftMenu._state.pluginIsRunning) {
this.leftMenu.btnThumbs.toggle(true, false); this.leftMenu.btnThumbs.toggle(true, false);
} }
} }
@ -551,6 +551,14 @@ define([
if (this.api) if (this.api)
this.api.asc_enableKeyEvents(value); this.api.asc_enableKeyEvents(value);
if (value) $(this.leftMenu.btnAbout.el).blur(); if (value) $(this.leftMenu.btnAbout.el).blur();
if (value && this.leftMenu._state.pluginIsRunning) {
this.leftMenu.panelPlugins.show();
this.leftMenu.$el.width(Common.localStorage.getItem('pe-mainmenu-width') || MENU_SCALE_PART);
if (this.mode.canCoAuthoring) {
this.mode.canViewComments && this.leftMenu.panelComments['hide']();
this.mode.canChat && this.leftMenu.panelChat['hide']();
}
}
}, },
menuFilesShowHide: function(state) { menuFilesShowHide: function(state) {
@ -659,7 +667,9 @@ define([
this.leftMenu.btnThumbs.toggle(false, false); this.leftMenu.btnThumbs.toggle(false, false);
this.leftMenu.panelPlugins.show(); this.leftMenu.panelPlugins.show();
this.leftMenu.onBtnMenuClick({pressed: true, options: {action: 'plugins'}}); this.leftMenu.onBtnMenuClick({pressed: true, options: {action: 'plugins'}});
this.leftMenu._state.pluginIsRunning = true;
} else { } else {
this.leftMenu._state.pluginIsRunning = false;
this.leftMenu.close(); this.leftMenu.close();
} }
} }
@ -670,6 +680,8 @@ define([
if (this.leftMenu.btnComments.isActive() && this.api) { if (this.leftMenu.btnComments.isActive() && this.api) {
this.leftMenu.btnComments.toggle(false); this.leftMenu.btnComments.toggle(false);
this.leftMenu.onBtnMenuClick(this.leftMenu.btnComments); this.leftMenu.onBtnMenuClick(this.leftMenu.btnComments);
if (this.leftMenu._state.pluginIsRunning) // hide comments panel when plugin is running
this.leftMenu.onCoauthOptions();
// focus to sdk // focus to sdk
this.api.asc_enableKeyEvents(true); this.api.asc_enableKeyEvents(true);

View file

@ -83,6 +83,7 @@ define([
initialize: function () { initialize: function () {
this.minimizedMode = true; this.minimizedMode = true;
this._state = {};
}, },
render: function () { render: function () {
@ -172,7 +173,8 @@ define([
onBtnMenuToggle: function(btn, state) { onBtnMenuToggle: function(btn, state) {
if (state) { if (state) {
btn.panel['show'](); btn.panel['show']();
this.$el.width(SCALE_MIN); if (!this._state.pluginIsRunning)
this.$el.width(SCALE_MIN);
if (this.btnSearch.isActive()) if (this.btnSearch.isActive())
this.btnSearch.toggle(false); this.btnSearch.toggle(false);
@ -192,16 +194,22 @@ define([
return; return;
} else } else
if (btn.options.action == 'thumbs') { if (btn.options.action == 'thumbs') {
if (this.$el.width() > SCALE_MIN) { if (!btn.pressed && this._state.pluginIsRunning) {
Common.localStorage.setItem('pe-mainmenu-width',this.$el.width()); this.$el.width(Common.localStorage.getItem('pe-mainmenu-width') || MENU_SCALE_PART);
this.$el.width(SCALE_MIN); } else {
if (this.$el.width() > SCALE_MIN) {
Common.localStorage.setItem('pe-mainmenu-width',this.$el.width());
this.$el.width(SCALE_MIN);
}
if (this._state.pluginIsRunning) // hide comments or chat panel when plugin is running
this.onCoauthOptions();
} }
} else { } else {
if (btn.pressed) { if (btn.pressed) {
if (!(this.$el.width() > SCALE_MIN)) { if (!(this.$el.width() > SCALE_MIN)) {
this.$el.width(Common.localStorage.getItem('pe-mainmenu-width') || MENU_SCALE_PART); this.$el.width(Common.localStorage.getItem('pe-mainmenu-width') || MENU_SCALE_PART);
} }
} else { } else if (!this._state.pluginIsRunning){
Common.localStorage.setItem('pe-mainmenu-width',this.$el.width()); Common.localStorage.setItem('pe-mainmenu-width',this.$el.width());
this.$el.width(SCALE_MIN); this.$el.width(SCALE_MIN);
} }
@ -235,12 +243,12 @@ define([
} }
} }
/** coauthoring end **/ /** coauthoring end **/
if (this.mode.canPlugins && this.panelPlugins) { // if (this.mode.canPlugins && this.panelPlugins) {
if (this.btnPlugins.pressed) { // if (this.btnPlugins.pressed) {
this.panelPlugins.show(); // this.panelPlugins.show();
} else // } else
this.panelPlugins['hide'](); // this.panelPlugins['hide']();
} // }
}, },
setOptionsPanel: function(name, panel) { setOptionsPanel: function(name, panel) {
@ -271,7 +279,8 @@ define([
close: function(menu) { close: function(menu) {
this.btnAbout.toggle(false); this.btnAbout.toggle(false);
this.btnThumbs.toggle(false); this.btnThumbs.toggle(false);
this.$el.width(SCALE_MIN); if (!this._state.pluginIsRunning)
this.$el.width(SCALE_MIN);
/** coauthoring begin **/ /** coauthoring begin **/
if (this.mode.canCoAuthoring) { if (this.mode.canCoAuthoring) {
if (this.mode.canViewComments) { if (this.mode.canViewComments) {
@ -286,7 +295,7 @@ define([
} }
} }
/** coauthoring end **/ /** coauthoring end **/
if (this.mode.canPlugins && this.panelPlugins) { if (this.mode.canPlugins && this.panelPlugins && !this._state.pluginIsRunning) {
this.panelPlugins['hide'](); this.panelPlugins['hide']();
this.btnPlugins.toggle(false, true); this.btnPlugins.toggle(false, true);
} }