[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') {
this.isThumbsShown = show;
} else {
if (!show && this.isThumbsShown) {
if (!show && this.isThumbsShown && !this.leftMenu._state.pluginIsRunning) {
this.leftMenu.btnThumbs.toggle(true, false);
}
}
@ -551,6 +551,14 @@ define([
if (this.api)
this.api.asc_enableKeyEvents(value);
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) {
@ -659,7 +667,9 @@ define([
this.leftMenu.btnThumbs.toggle(false, false);
this.leftMenu.panelPlugins.show();
this.leftMenu.onBtnMenuClick({pressed: true, options: {action: 'plugins'}});
this.leftMenu._state.pluginIsRunning = true;
} else {
this.leftMenu._state.pluginIsRunning = false;
this.leftMenu.close();
}
}
@ -670,6 +680,8 @@ define([
if (this.leftMenu.btnComments.isActive() && this.api) {
this.leftMenu.btnComments.toggle(false);
this.leftMenu.onBtnMenuClick(this.leftMenu.btnComments);
if (this.leftMenu._state.pluginIsRunning) // hide comments panel when plugin is running
this.leftMenu.onCoauthOptions();
// focus to sdk
this.api.asc_enableKeyEvents(true);

View file

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