Commit 1d30bce4 authored by Julia Radzhabova's avatar Julia Radzhabova

[PE] Fix Bug 35231.

parent df4f76c5
......@@ -107,6 +107,7 @@ define([
_.extend(this, options);
this.pages = new PE.Models.Pages({current:1, count:1});
this.pages.on('change', _.bind(_updatePagesCaption,this));
this._state = {no_paragraph: true};
},
render: function () {
......@@ -354,6 +355,8 @@ define([
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onApiUsersChanged, this));
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onApiUsersChanged, this));
/** coauthoring end **/
this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onApiFocusObject, this));
}
return this;
......@@ -459,7 +462,7 @@ define([
this.langMenu.doLayout();
if (this.langMenu.items.length>0) {
this.btnLanguage.setDisabled(false);
this.btnLanguage.setDisabled(false || this._state.no_paragraph);
this.btnDocLanguage.setDisabled(false);
}
},
......@@ -483,10 +486,26 @@ define([
SetDisabled: function(disable) {
var langs = this.langMenu.items.length>0;
this.btnLanguage.setDisabled(disable || !langs);
this.btnLanguage.setDisabled(disable || !langs || this._state.no_paragraph);
this.btnDocLanguage.setDisabled(disable || !langs);
},
onApiFocusObject: function(selectedObjects) {
if (!this.mode.isEdit) return;
this._state.no_paragraph = true;
var i = -1;
while (++i < selectedObjects.length) {
if (selectedObjects[i].get_ObjectType() == Asc.c_oAscTypeSelectElement.Paragraph) {
this._state.no_paragraph = selectedObjects[i].get_ObjectValue().get_Locked();
break;
}
}
this._state.no_paragraph = this._state.no_paragraph || this.langMenu.items.length<1;
if (this._state.no_paragraph !== this.btnLanguage.isDisabled())
this.btnLanguage.setDisabled(this._state.no_paragraph);
},
pageIndexText : 'Slide {0} of {1}',
goToPageText : 'Go to Slide',
tipUsers : 'Document is currently being edited by several users.',
......
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