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
8af3bb73
Commit
8af3bb73
authored
Jun 26, 2016
by
Mitsuhiro Tanda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor
parent
16dc0953
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
public/app/features/templating/templateValuesSrv.js
+20
-20
No files found.
public/app/features/templating/templateValuesSrv.js
View file @
8af3bb73
...
...
@@ -359,29 +359,29 @@ function (angular, _, kbn) {
}
options
=
_
.
uniq
(
options
,
'value'
);
var
sortType
=
Math
.
ceil
(
variable
.
sort
/
2
);
if
(
sortType
===
0
)
{
if
(
variable
.
sort
===
0
)
{
return
options
;
}
else
{
if
(
sortType
===
1
)
{
options
=
_
.
sortBy
(
options
,
'text'
);
}
else
if
(
sortType
===
2
)
{
options
=
_
.
sortBy
(
options
,
function
(
opt
)
{
var
matches
=
opt
.
text
.
match
(
/.*
?(\d
+
)
.*/
);
if
(
!
matches
)
{
return
0
;
}
else
{
return
parseInt
(
matches
[
1
],
10
);
}
});
}
if
(
variable
.
sort
%
2
===
0
)
{
options
=
options
.
reverse
();
}
}
return
options
;
var
sortType
=
Math
.
ceil
(
variable
.
sort
/
2
);
var
reverseSort
=
(
variable
.
sort
%
2
===
0
);
if
(
sortType
===
1
)
{
options
=
_
.
sortBy
(
options
,
'text'
);
}
else
if
(
sortType
===
2
)
{
options
=
_
.
sortBy
(
options
,
function
(
opt
)
{
var
matches
=
opt
.
text
.
match
(
/.*
?(\d
+
)
.*/
);
if
(
!
matches
)
{
return
0
;
}
else
{
return
parseInt
(
matches
[
1
],
10
);
}
});
}
if
(
reverseSort
)
{
options
=
options
.
reverse
();
}
return
options
;
};
this
.
addAllOption
=
function
(
variable
)
{
...
...
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