[PE] Refactoring language button
This commit is contained in:
parent
de57a03ea2
commit
4e644daac1
|
@ -1692,6 +1692,7 @@ define([
|
|||
if (this.languages && this.languages.length>0) {
|
||||
this.getApplication().getController('DocumentHolder').getView('DocumentHolder').setLanguages(this.languages);
|
||||
this.getApplication().getController('Statusbar').setLanguages(this.languages);
|
||||
this.getApplication().getController('Common.Controllers.ReviewChanges').setLanguages(this.languages);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -80,8 +80,7 @@ define([
|
|||
events: function() {
|
||||
return {
|
||||
'click #btn-zoom-down': _.bind(this.zoomDocument,this,'down'),
|
||||
'click #btn-zoom-up': _.bind(this.zoomDocument,this,'up'),
|
||||
'click #btn-doc-lang':_.bind(this.onBtnLanguage,this)
|
||||
'click #btn-zoom-up': _.bind(this.zoomDocument,this,'up')
|
||||
};
|
||||
},
|
||||
|
||||
|
@ -105,6 +104,8 @@ define([
|
|||
var review = me.getApplication().getController('Common.Controllers.ReviewChanges').getView();
|
||||
me.btnSpelling = review.getButton('spelling', 'statusbar');
|
||||
me.btnSpelling.render( me.statusbar.$el.find('#btn-doc-spell') );
|
||||
me.btnDocLang = review.getButton('doclang', 'statusbar');
|
||||
me.btnDocLang.render( me.statusbar.$el.find('#btn-doc-lang') );
|
||||
} else {
|
||||
me.statusbar.$el.find('.el-edit, .el-review').hide();
|
||||
}
|
||||
|
@ -214,20 +215,6 @@ define([
|
|||
this.statusbar.$el.css('z-index', '');
|
||||
},
|
||||
|
||||
onBtnLanguage: function() {
|
||||
var me = this;
|
||||
(new Common.Views.LanguageDialog({
|
||||
languages: me.langs,
|
||||
current: me.api.asc_getDefaultLanguage(),
|
||||
handler: function(result, value) {
|
||||
if (result=='ok') {
|
||||
var record = _.findWhere(me.langs, {'value':value});
|
||||
record && me.api.asc_setDefaultLanguage(record.code);
|
||||
}
|
||||
}
|
||||
})).show();
|
||||
},
|
||||
|
||||
onLangMenu: function(obj, langid, title) {
|
||||
this.api.put_TextPrLang(langid);
|
||||
},
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
<div class="caret up img-commonctrl" />
|
||||
</div>
|
||||
</div>
|
||||
<button id="btn-doc-lang" type="button" class="btn small btn-toolbar el-edit"><i class="icon"></i></button>
|
||||
<span id="btn-doc-lang" class="el-edit"></span>
|
||||
<span id="btn-doc-spell" class="el-edit"></span>
|
||||
<div class="separator short el-edit"></div>
|
||||
<button id="btn-zoom-topage" type="button" class="btn small btn-toolbar"><i class="icon"></i></button>
|
||||
|
|
|
@ -247,13 +247,6 @@ define([
|
|||
});
|
||||
this.btnPreview.render($('#slot-status-btn-preview'));
|
||||
|
||||
this.btnDocLanguage = new Common.UI.Button({
|
||||
el: $('#btn-doc-lang',this.el),
|
||||
hint: this.tipSetDocLang,
|
||||
hintAnchor: 'top',
|
||||
disabled: true
|
||||
});
|
||||
|
||||
var panelLang = $('.cnt-lang',this.el);
|
||||
this.langMenu = new Common.UI.Menu({
|
||||
cls: 'lang-menu',
|
||||
|
@ -349,7 +342,6 @@ define([
|
|||
|
||||
if (this.langMenu.items.length>0) {
|
||||
this.btnLanguage.setDisabled(false || this._state.no_paragraph);
|
||||
this.btnDocLanguage.setDisabled(!!this.mode.isDisconnected);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -372,7 +364,6 @@ define([
|
|||
SetDisabled: function(disable) {
|
||||
var langs = this.langMenu.items.length>0;
|
||||
this.btnLanguage.setDisabled(disable || !langs || this._state.no_paragraph);
|
||||
this.btnDocLanguage.setDisabled(disable || !langs);
|
||||
this.mode.isEdit = !disable;
|
||||
},
|
||||
|
||||
|
@ -409,7 +400,6 @@ define([
|
|||
tipPreview : 'Start Slideshow',
|
||||
tipAccessRights : 'Manage document access rights',
|
||||
tipSetLang : 'Set Text Language',
|
||||
tipSetDocLang : 'Set Document Language',
|
||||
textShowBegin: 'Show from Beginning',
|
||||
textShowCurrent: 'Show from Current slide',
|
||||
textShowPresenterView: 'Show presenter view'
|
||||
|
|
|
@ -1538,7 +1538,7 @@
|
|||
"PE.Views.Statusbar.tipFitPage": "Fit to slide",
|
||||
"PE.Views.Statusbar.tipFitWidth": "Fit to width",
|
||||
"PE.Views.Statusbar.tipPreview": "Start slideshow",
|
||||
"PE.Views.Statusbar.tipSetDocLang": "Set document language",
|
||||
"del_PE.Views.Statusbar.tipSetDocLang": "Set document language",
|
||||
"PE.Views.Statusbar.tipSetLang": "Set text language",
|
||||
"del_PE.Views.Statusbar.tipSetSpelling": "Spell checking",
|
||||
"PE.Views.Statusbar.tipZoomFactor": "Zoom",
|
||||
|
|
|
@ -58,7 +58,6 @@
|
|||
}
|
||||
|
||||
#btn-doc-lang {
|
||||
.btn-tpl(-1500px);
|
||||
margin-right: 9px;
|
||||
}
|
||||
|
||||
|
|
|
@ -274,6 +274,7 @@
|
|||
.button-normal-icon(flip-hor, 81, @toolbar-icon-size);
|
||||
.button-normal-icon(flip-vert, 82, @toolbar-icon-size);
|
||||
|
||||
.button-normal-icon(btn-ic-doclang, 75, @toolbar-icon-size);
|
||||
.button-normal-icon(btn-ic-docspell, 76, @toolbar-icon-size);
|
||||
|
||||
@menu-icon-size: 22px;
|
||||
|
|
Loading…
Reference in a new issue