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
812e4c7c
Commit
812e4c7c
authored
Sep 11, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: moved array join directive to typecrtipt
parent
85baae1e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
38 deletions
+27
-38
public/app/core/core.ts
+1
-1
public/app/core/directives/array_join.ts
+26
-29
public/app/core/directives/cool_dir.ts
+0
-7
public/app/directives/all.js
+0
-1
No files found.
public/app/core/core.ts
View file @
812e4c7c
export
*
from
'./directives/
cool_dir
'
export
*
from
'./directives/
array_join
'
export
*
from
'./routes/module_loader'
export
*
from
'./filters/filters'
...
...
public/app/
directives/arrayJoin.j
s
→
public/app/
core/directives/array_join.t
s
View file @
812e4c7c
define
([
'angular'
,
'app'
,
'lodash'
],
function
(
angular
,
app
,
_
)
{
'use strict'
;
///<reference path="../../headers/common.d.ts" />
angular
.
module
(
'grafana.directives'
)
.
directive
(
'arrayJoin'
,
function
()
{
return
{
restrict
:
'A'
,
require
:
'ngModel'
,
link
:
function
(
scope
,
element
,
attr
,
ngModel
)
{
import
angular
=
require
(
'angular'
);
import
_
=
require
(
'lodash'
);
function
split_array
(
text
)
{
return
(
text
||
''
).
split
(
','
);
}
export
function
ArrayJoin
()
{
return
{
restrict
:
'A'
,
require
:
'ngModel'
,
link
:
function
(
scope
,
element
,
attr
,
ngModel
)
{
function
join_array
(
text
)
{
if
(
_
.
isArray
(
text
))
{
return
(
text
||
''
).
join
(
','
);
}
else
{
return
text
;
}
}
function
split_array
(
text
)
{
return
(
text
||
''
).
split
(
','
);
}
ngModel
.
$parsers
.
push
(
split_array
);
ngModel
.
$formatters
.
push
(
join_array
);
function
join_array
(
text
)
{
if
(
_
.
isArray
(
text
))
{
return
(
text
||
''
).
join
(
','
);
}
else
{
return
text
;
}
};
});
}
ngModel
.
$parsers
.
push
(
split_array
);
ngModel
.
$formatters
.
push
(
join_array
);
}
};
}
angular
.
module
(
'grafana.directives'
).
directive
(
'arrayJoin'
,
ArrayJoin
);
});
public/app/core/directives/cool_dir.ts
deleted
100644 → 0
View file @
85baae1e
export
class
CoolDir
{
getName
()
:
string
{
return
"CoolDir"
;
}
}
public/app/directives/all.js
View file @
812e4c7c
define
([
'./arrayJoin'
,
'./dashUpload'
,
'./grafanaSimplePanel'
,
'./dashEditLink'
,
...
...
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