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