Skip to content
Snippets Groups Projects
Commit 91f355ee authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Add the configuration fontFamily to AceEditor.

parent 845e7a16
No related branches found
No related tags found
No related merge requests found
...@@ -14,11 +14,17 @@ Ext.define('App.form.field.AceEditor', { ...@@ -14,11 +14,17 @@ Ext.define('App.form.field.AceEditor', {
}, },
alias: 'widget.xaceeditorfield', alias: 'widget.xaceeditorfield',
/**
* @cfg {String}
* The font family (work only with monospace family)
*/
fontFamily: "Liberation Mono",
/** /**
* @cfg {Number} * @cfg {Number}
* The font size in pixels * The font size in pixels
*/ */
fontSize: 10, fontSize: 11,
/** /**
* @cfg {String} * @cfg {String}
...@@ -54,8 +60,8 @@ Ext.define('App.form.field.AceEditor', { ...@@ -54,8 +60,8 @@ Ext.define('App.form.field.AceEditor', {
}]; }];
me.callParent(arguments); me.callParent(arguments);
me.panel = me.child('panel');
me.panel = me.child('panel');
me.panel.on('afterrender', me.addEditor, me); me.panel.on('afterrender', me.addEditor, me);
me.initField(); me.initField();
...@@ -84,6 +90,7 @@ Ext.define('App.form.field.AceEditor', { ...@@ -84,6 +90,7 @@ Ext.define('App.form.field.AceEditor', {
me.editor = ace.edit(me.panel.getId()); me.editor = ace.edit(me.panel.getId());
me.editor.getSession().setMode('ace/mode/' + me.language); me.editor.getSession().setMode('ace/mode/' + me.language);
me.editor.setFontSize(me.fontSize); me.editor.setFontSize(me.fontSize);
me.editor.setOption("fontFamily", me.fontFamily);
if (me.theme) { if (me.theme) {
me.editor.setTheme('ace/theme/' + me.theme); me.editor.setTheme('ace/theme/' + me.theme);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment