[DE][SSE] Show running inside-plugin in the left panel after hiding comment, chat, about panels.

This commit is contained in:
Julia Radzhabova 2017-08-18 17:08:45 +03:00
parent a394ef749a
commit 3fb4d7abcb
5 changed files with 45 additions and 21 deletions

View file

@ -234,7 +234,7 @@ define([
this.iframePlugin = null;
}
this.currentPluginPanel.toggleClass('hidden', true);
this.pluginsPanel.toggleClass('hidden', false);
// this.pluginsPanel.toggleClass('hidden', false);
this.fireEvent('plugin:open', [this, 'onboard', 'close']);
},

View file

@ -539,6 +539,13 @@ 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();
if (this.mode.canCoAuthoring) {
this.mode.canComments && this.leftMenu.panelComments['hide']();
this.mode.canChat && this.leftMenu.panelChat['hide']();
}
}
},
menuFilesShowHide: function(state) {
@ -645,7 +652,9 @@ define([
this.leftMenu.close();
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();
}
}

View file

@ -84,6 +84,7 @@ define([
initialize: function () {
this.minimizedMode = true;
this._state = {};
},
render: function () {
@ -163,6 +164,7 @@ define([
onBtnMenuToggle: function(btn, state) {
if (state) {
btn.panel['show']();
if (!this._state.pluginIsRunning)
this.$el.width(SCALE_MIN);
if (this.btnSearch.isActive())
@ -190,7 +192,7 @@ define([
if (!(this.$el.width() > SCALE_MIN)) {
this.$el.width(parseInt(Common.localStorage.getItem('de-mainmenu-width')) || MENU_SCALE_PART);
}
} else {
} else if (!this._state.pluginIsRunning) {
Common.localStorage.setItem('de-mainmenu-width',this.$el.width());
this.$el.width(SCALE_MIN);
}
@ -221,12 +223,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) {
@ -262,6 +264,7 @@ define([
this.menuFile.hide();
} else {
this.btnAbout.toggle(false);
if (!this._state.pluginIsRunning)
this.$el.width(SCALE_MIN);
/** coauthoring begin **/
if (this.mode.canCoAuthoring) {
@ -277,7 +280,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);
}

View file

@ -607,6 +607,13 @@ define([
this.api.asc_enableKeyEvents(!state);
if (!state) $(this.leftMenu.btnAbout.el).blur();
if (!state && this.leftMenu._state.pluginIsRunning) {
this.leftMenu.panelPlugins.show();
if (this.mode.canCoAuthoring) {
this.mode.canComments && this.leftMenu.panelComments['hide']();
this.mode.canChat && this.leftMenu.panelChat['hide']();
}
}
}
},
@ -739,7 +746,9 @@ define([
this.leftMenu.close();
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();
}
}

View file

@ -74,6 +74,7 @@ define([
initialize: function () {
this.minimizedMode = true;
this._state = {};
},
render: function () {
@ -153,6 +154,7 @@ define([
onBtnMenuToggle: function(btn, state) {
if (state) {
btn.panel['show']();
if (!this._state.pluginIsRunning)
this.$el.width(SCALE_MIN);
if (this.btnSearch.isActive())
@ -178,7 +180,7 @@ define([
if (!(this.$el.width() > SCALE_MIN)) {
this.$el.width(Common.localStorage.getItem('sse-mainmenu-width') || MENU_SCALE_PART);
}
} else {
} else if (!this._state.pluginIsRunning){
Common.localStorage.setItem('sse-mainmenu-width',this.$el.width());
this.$el.width(SCALE_MIN);
}
@ -208,12 +210,12 @@ define([
this.panelChat['hide']();
}
}
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) {
@ -241,6 +243,7 @@ define([
close: function(menu) {
this.btnAbout.toggle(false);
if (!this._state.pluginIsRunning)
this.$el.width(SCALE_MIN);
/** coauthoring begin **/
if (this.mode.canCoAuthoring) {
@ -256,7 +259,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);
}