Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
w2pext
plugin_dbui
Commits
ee46e174
Commit
ee46e174
authored
Oct 21, 2016
by
LE GAC Renaud
Browse files
Update AceEditor to simplify the javaScript code.
parent
0896b426
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
31 deletions
+9
-31
static/plugin_dbui/src/form/field/AceEditor.js
static/plugin_dbui/src/form/field/AceEditor.js
+9
-31
No files found.
static/plugin_dbui/src/form/field/AceEditor.js
View file @
ee46e174
...
...
@@ -48,8 +48,6 @@ Ext.define('Dbui.form.field.AceEditor', {
// private property
editor
:
null
,
panel
:
null
,
value
:
undefined
,
// jshint strict: false
...
...
@@ -59,13 +57,10 @@ Ext.define('Dbui.form.field.AceEditor', {
var
me
=
this
;
me
.
items
=
[{
height
:
me
.
editorHeight
,
layout
:
'
fit
'
,
frame
:
true
,
items
:
{
xtype
:
'
component
'
,
height
:
me
.
editorHeight
},
xtype
:
'
panel
'
style
:
'
border: 1px solid #99BCE8;
'
,
xtype
:
'
component
'
}];
me
.
anchor
=
'
100%
'
;
...
...
@@ -75,17 +70,18 @@ Ext.define('Dbui.form.field.AceEditor', {
},
// private method requests by the component model of ExtJS
// notice that afterLayout is called after setValue
//
// NOTE:
// - method afterLayout is called after setValue
// - method setValue fill the property me.value
//
afterLayout
:
function
()
{
var
me
=
this
;
if
(
!
me
.
panel
)
{
me
.
panel
=
me
.
child
(
'
panel
'
);
}
// instantiate the editor
if
(
!
me
.
editor
)
{
me
.
editor
=
ace
.
edit
(
me
.
panel
.
child
(
'
component
'
).
getId
());
me
.
editor
=
ace
.
edit
(
me
.
child
(
'
component
'
).
getId
());
me
.
editor
.
getSession
().
setMode
(
'
ace/mode/
'
+
me
.
language
);
me
.
editor
.
setTheme
(
'
ace/theme/
'
+
me
.
theme
);
me
.
editor
.
setFontSize
(
me
.
fontSize
);
...
...
@@ -107,7 +103,6 @@ Ext.define('Dbui.form.field.AceEditor', {
me
.
editor
.
destroy
();
delete
me
.
editor
;
delete
me
.
panel
;
me
.
callParent
(
arguments
);
},
...
...
@@ -130,22 +125,5 @@ Ext.define('Dbui.form.field.AceEditor', {
}
return
undefined
;
},
/**
* Set the value for this field.
* Notice that setValue is called before afterLayout
*
* @param {String} value
*
*/
setValue
:
function
(
value
)
{
"
use strict
"
;
var
me
=
this
;
me
.
value
=
value
;
return
me
;
}
});
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment