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
03fb152d
Commit
03fb152d
authored
Sep 13, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tech(templates): extract sort method
parent
9c5436c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
public/app/features/templating/templateValuesSrv.js
+11
-7
No files found.
public/app/features/templating/templateValuesSrv.js
View file @
03fb152d
...
...
@@ -374,12 +374,20 @@ function (angular, _, $, kbn) {
}
options
=
_
.
uniq
(
options
,
'value'
);
if
(
variable
.
sort
===
0
)
{
return
this
.
sortVariableValues
(
options
,
variable
.
sort
);
};
this
.
addAllOption
=
function
(
variable
)
{
variable
.
options
.
unshift
({
text
:
'All'
,
value
:
"$__all"
});
};
this
.
sortVariableValues
=
function
(
options
,
sortOrder
)
{
if
(
sortOrder
===
0
)
{
return
options
;
}
var
sortType
=
Math
.
ceil
(
variable
.
sort
/
2
);
var
reverseSort
=
(
variable
.
sort
%
2
===
0
);
var
sortType
=
Math
.
ceil
(
sortOrder
/
2
);
var
reverseSort
=
(
sortOrder
%
2
===
0
);
if
(
sortType
===
1
)
{
options
=
_
.
sortBy
(
options
,
'text'
);
}
else
if
(
sortType
===
2
)
{
...
...
@@ -399,10 +407,6 @@ function (angular, _, $, kbn) {
return
options
;
};
this
.
addAllOption
=
function
(
variable
)
{
variable
.
options
.
unshift
({
text
:
'All'
,
value
:
"$__all"
});
};
});
});
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