Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
apollo
Commits
86a5a651
Unverified
Commit
86a5a651
authored
Apr 04, 2018
by
张乐
Committed by
GitHub
Apr 04, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1037 from wiston1988/master
修复头部搜索项目时的bug
parents
d6b4ff82
2d058e43
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
directive.js
.../src/main/resources/static/scripts/directive/directive.js
+8
-8
nav.html
...lo-portal/src/main/resources/static/views/common/nav.html
+1
-1
No files found.
apollo-portal/src/main/resources/static/scripts/directive/directive.js
View file @
86a5a651
...
...
@@ -14,14 +14,14 @@ directive_module.directive('apollonav',
});
scope
.
sourceApps
=
[];
scope
.
cop
y
edApps
=
[];
scope
.
cop
i
edApps
=
[];
AppService
.
find_apps
().
then
(
function
(
result
)
{
result
.
forEach
(
function
(
app
)
{
app
.
selected
=
false
;
scope
.
sourceApps
.
push
(
app
);
});
scope
.
cop
y
edApps
=
angular
.
copy
(
scope
.
sourceApps
);
scope
.
cop
i
edApps
=
angular
.
copy
(
scope
.
sourceApps
);
},
function
(
result
)
{
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"load apps error"
);
});
...
...
@@ -36,12 +36,12 @@ directive_module.directive('apollonav',
};
scope
.
changeSearchKey
=
function
()
{
scope
.
cop
y
edApps
=
[];
scope
.
cop
i
edApps
=
[];
var
searchKey
=
scope
.
searchKey
.
toLocaleLowerCase
();
scope
.
sourceApps
.
forEach
(
function
(
app
)
{
if
(
app
.
name
.
toLocaleLowerCase
().
indexOf
(
searchKey
)
>
-
1
||
app
.
appId
.
toLocaleLowerCase
().
indexOf
(
searchKey
)
>
-
1
)
{
scope
.
cop
y
edApps
.
push
(
app
);
scope
.
cop
i
edApps
.
push
(
app
);
}
});
scope
.
shouldShowAppList
=
true
;
...
...
@@ -63,18 +63,18 @@ directive_module.directive('apollonav',
element
.
bind
(
"keydown keypress"
,
function
(
event
)
{
if
(
event
.
keyCode
==
40
)
{
if
(
selectedAppIdx
<
scope
.
cop
y
edApps
.
length
-
1
)
{
if
(
selectedAppIdx
<
scope
.
cop
i
edApps
.
length
-
1
)
{
clearAppsSelectedStatus
();
scope
.
cop
y
edApps
[
++
selectedAppIdx
].
selected
=
true
;
scope
.
cop
i
edApps
[
++
selectedAppIdx
].
selected
=
true
;
}
}
else
if
(
event
.
keyCode
==
38
)
{
if
(
selectedAppIdx
>=
1
)
{
clearAppsSelectedStatus
();
scope
.
cop
y
edApps
[
--
selectedAppIdx
].
selected
=
true
;
scope
.
cop
i
edApps
[
--
selectedAppIdx
].
selected
=
true
;
}
}
else
if
(
event
.
keyCode
==
13
)
{
if
(
scope
.
shouldShowAppList
&&
selectedAppIdx
>
-
1
)
{
select
(
scope
.
cop
y
edApps
[
selectedAppIdx
]);
select
(
scope
.
cop
i
edApps
[
selectedAppIdx
]);
event
.
preventDefault
();
}
else
{
scope
.
jumpToConfigPage
();
...
...
apollo-portal/src/main/resources/static/views/common/nav.html
View file @
86a5a651
...
...
@@ -53,7 +53,7 @@
ng-model=
"searchKey"
ng-change=
"changeSearchKey()"
ng-focus=
"changeSearchKey()"
>
<div
class=
"row app-list"
ng-show=
"shouldShowAppList"
>
<div
ng-repeat=
"app in cop
y
edApps"
class=
"app-item"
ng-class=
"{'app-selected':app.selected}"
<div
ng-repeat=
"app in cop
i
edApps"
class=
"app-item"
ng-class=
"{'app-selected':app.selected}"
ng-click=
"selectApp(app)"
>
{{app.appId}} / {{app.name}}
</div>
</div>
...
...
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