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
4a9380cc
Commit
4a9380cc
authored
Sep 03, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added limit checks to up/down arrow key selection of search results
parent
9f60745e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
src/app/controllers/search.js
+7
-2
No files found.
src/app/controllers/search.js
View file @
4a9380cc
...
...
@@ -31,10 +31,10 @@ function (angular, _, config, $) {
$scope
.
emitAppEvent
(
'hide-dash-editor'
);
}
if
(
evt
.
keyCode
===
40
)
{
$scope
.
selectedIndex
++
;
$scope
.
moveSelection
(
1
)
;
}
if
(
evt
.
keyCode
===
38
)
{
$scope
.
selectedIndex
--
;
$scope
.
moveSelection
(
-
1
)
;
}
if
(
evt
.
keyCode
===
13
)
{
if
(
$scope
.
tagsOnly
)
{
...
...
@@ -56,6 +56,10 @@ function (angular, _, config, $) {
}
};
$scope
.
moveSelection
=
function
(
direction
)
{
$scope
.
selectedIndex
=
Math
.
max
(
Math
.
min
(
$scope
.
selectedIndex
+
direction
,
$scope
.
resultCount
-
1
),
0
);
};
$scope
.
goToDashboard
=
function
(
id
)
{
$location
.
path
(
"/dashboard/db/"
+
id
);
};
...
...
@@ -76,6 +80,7 @@ function (angular, _, config, $) {
$scope
.
tagsOnly
=
results
.
tagsOnly
;
$scope
.
results
.
dashboards
=
results
.
dashboards
;
$scope
.
results
.
tags
=
results
.
tags
;
$scope
.
resultCount
=
results
.
tagsOnly
?
results
.
tags
.
length
:
results
.
dashboards
.
length
;
});
};
...
...
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