[DE] Disable language button in the status bar until languages are loaded.

This commit is contained in:
Julia Radzhabova 2016-11-02 16:40:35 +03:00
parent 24ad7e79d7
commit 6804c4a2de

View file

@ -150,7 +150,8 @@ define([
this.btnDocLanguage = new Common.UI.Button({ this.btnDocLanguage = new Common.UI.Button({
el: $('#btn-doc-lang',this.el), el: $('#btn-doc-lang',this.el),
hint: this.tipSetDocLang, hint: this.tipSetDocLang,
hintAnchor: 'top' hintAnchor: 'top',
disabled: true
}); });
this.btnSetSpelling = new Common.UI.Button({ this.btnSetSpelling = new Common.UI.Button({
@ -203,7 +204,8 @@ define([
this.btnLanguage = new Common.UI.Button({ this.btnLanguage = new Common.UI.Button({
el: panelLang, el: panelLang,
hint: this.tipSetLang, hint: this.tipSetLang,
hintAnchor: 'top-left' hintAnchor: 'top-left',
disabled: true
}); });
this.btnLanguage.cmpEl.on({ this.btnLanguage.cmpEl.on({
'show.bs.dropdown': function () { 'show.bs.dropdown': function () {
@ -465,6 +467,10 @@ define([
}, this); }, this);
this.langMenu.doLayout(); this.langMenu.doLayout();
if (this.langMenu.items.length>0) {
this.btnLanguage.setDisabled(false);
this.btnDocLanguage.setDisabled(false);
}
}, },
setLanguage: function(info) { setLanguage: function(info) {
@ -493,8 +499,9 @@ define([
}, },
SetDisabled: function(disable) { SetDisabled: function(disable) {
this.btnLanguage.setDisabled(disable); var langs = this.langMenu.items.length>0;
this.btnDocLanguage.setDisabled(disable); this.btnLanguage.setDisabled(disable || !langs);
this.btnDocLanguage.setDisabled(disable || !langs);
if (disable) { if (disable) {
this.state.changespanel = this.mnuChangesPanel.checked; this.state.changespanel = this.mnuChangesPanel.checked;
} }