Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
f9acb415
Commit
f9acb415
authored
Mar 20, 2018
by
ryan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose option to disable snippets
parent
fdf7a4c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
+5
-1
public/app/core/components/code_editor/code_editor.ts
+5
-1
No files found.
public/app/core/components/code_editor/code_editor.ts
View file @
f9acb415
...
@@ -21,6 +21,8 @@
...
@@ -21,6 +21,8 @@
* data-tab-size - Tab size, default is 2.
* data-tab-size - Tab size, default is 2.
* data-behaviours-enabled - Specifies whether to use behaviors or not. "Behaviors" in this case is the auto-pairing of
* data-behaviours-enabled - Specifies whether to use behaviors or not. "Behaviors" in this case is the auto-pairing of
* special characters, like quotation marks, parenthesis, or brackets.
* special characters, like quotation marks, parenthesis, or brackets.
* data-snippets-enabled - Specifies whether to use snippets or not. "Snippets" are small pieces of code that can be
* inserted via the completion box.
*
*
* Keybindings:
* Keybindings:
* Ctrl-Enter (Command-Enter): run onChange() function
* Ctrl-Enter (Command-Enter): run onChange() function
...
@@ -49,6 +51,7 @@ const DEFAULT_MODE = 'text';
...
@@ -49,6 +51,7 @@ const DEFAULT_MODE = 'text';
const
DEFAULT_MAX_LINES
=
10
;
const
DEFAULT_MAX_LINES
=
10
;
const
DEFAULT_TAB_SIZE
=
2
;
const
DEFAULT_TAB_SIZE
=
2
;
const
DEFAULT_BEHAVIOURS
=
true
;
const
DEFAULT_BEHAVIOURS
=
true
;
const
DEFAULT_SNIPPETS
=
true
;
let
editorTemplate
=
`<div></div>`
;
let
editorTemplate
=
`<div></div>`
;
...
@@ -59,6 +62,7 @@ function link(scope, elem, attrs) {
...
@@ -59,6 +62,7 @@ function link(scope, elem, attrs) {
let
showGutter
=
attrs
.
showGutter
!==
undefined
;
let
showGutter
=
attrs
.
showGutter
!==
undefined
;
let
tabSize
=
attrs
.
tabSize
||
DEFAULT_TAB_SIZE
;
let
tabSize
=
attrs
.
tabSize
||
DEFAULT_TAB_SIZE
;
let
behavioursEnabled
=
attrs
.
behavioursEnabled
?
attrs
.
behavioursEnabled
===
'true'
:
DEFAULT_BEHAVIOURS
;
let
behavioursEnabled
=
attrs
.
behavioursEnabled
?
attrs
.
behavioursEnabled
===
'true'
:
DEFAULT_BEHAVIOURS
;
let
snippetsEnabled
=
attrs
.
snippetsEnabled
?
attrs
.
snippetsEnabled
===
'true'
:
DEFAULT_SNIPPETS
;
// Initialize editor
// Initialize editor
let
aceElem
=
elem
.
get
(
0
);
let
aceElem
=
elem
.
get
(
0
);
...
@@ -143,7 +147,7 @@ function link(scope, elem, attrs) {
...
@@ -143,7 +147,7 @@ function link(scope, elem, attrs) {
codeEditor
.
setOptions
({
codeEditor
.
setOptions
({
enableBasicAutocompletion
:
true
,
enableBasicAutocompletion
:
true
,
enableLiveAutocompletion
:
true
,
enableLiveAutocompletion
:
true
,
enableSnippets
:
true
,
enableSnippets
:
snippetsEnabled
,
});
});
if
(
scope
.
getCompleter
())
{
if
(
scope
.
getCompleter
())
{
...
...
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