[DE][PE] Close toolbar menus when toolbar is collapsed. Collapse toolbar when document context menu is opened.

This commit is contained in:
Julia Radzhabova 2017-04-24 17:35:00 +03:00
parent d503fd94fc
commit 293d08c2be
3 changed files with 13 additions and 2 deletions

View file

@ -42,7 +42,7 @@
*/
define([
'backbone',
'backbone'
], function (Backbone) {
'use strict';
@ -169,7 +169,8 @@ define([
},
collapseToolbar: function() {
optsFold.$bar.removeClass('expanded');
optsFold.$bar && optsFold.$bar.removeClass('expanded');
Common.UI.Menu.Manager.hideAll();
},
expandToolbar: function() {

View file

@ -325,6 +325,7 @@ define([
this.api.asc_registerCallback('asc_onMathTypes', _.bind(this.onMathTypes, this));
this.api.asc_registerCallback('asc_onColumnsProps', _.bind(this.onColumnsProps, this));
this.api.asc_registerCallback('asc_onSectionProps', _.bind(this.onSectionProps, this));
this.api.asc_registerCallback('asc_onContextMenu', _.bind(this.onContextMenu, this));
},
onChangeCompactView: function(view, compact) {
@ -346,6 +347,10 @@ define([
}
},
onContextMenu: function() {
this.toolbar.collapseToolbar();
},
onApiFontSize: function(size) {
if (this._state.fontsize !== size) {
this.toolbar.cmbFontSize.setValue(size);

View file

@ -309,6 +309,7 @@ define([
this.api.asc_registerCallback('asc_onCountPages', _.bind(this.onApiCountPages, this));
this.api.asc_registerCallback('asc_onMathTypes', _.bind(this.onMathTypes, this));
this.api.asc_registerCallback('asc_onContextMenu', _.bind(this.onContextMenu, this));
this.onSetupCopyStyleButton();
},
@ -332,6 +333,10 @@ define([
}
},
onContextMenu: function() {
this.toolbar.collapseToolbar();
},
onApiFontSize: function(size) {
if (this._state.fontsize !== size) {
this.toolbar.cmbFontSize.setValue(size);