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
2d058e43
Commit
2d058e43
authored
Apr 04, 2018
by
陈慧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix search app bug
parent
49b27bd0
Hide 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 @
2d058e43
...
@@ -14,14 +14,14 @@ directive_module.directive('apollonav',
...
@@ -14,14 +14,14 @@ directive_module.directive('apollonav',
});
});
scope
.
sourceApps
=
[];
scope
.
sourceApps
=
[];
scope
.
cop
y
edApps
=
[];
scope
.
cop
i
edApps
=
[];
AppService
.
find_apps
().
then
(
function
(
result
)
{
AppService
.
find_apps
().
then
(
function
(
result
)
{
result
.
forEach
(
function
(
app
)
{
result
.
forEach
(
function
(
app
)
{
app
.
selected
=
false
;
app
.
selected
=
false
;
scope
.
sourceApps
.
push
(
app
);
scope
.
sourceApps
.
push
(
app
);
});
});
scope
.
cop
y
edApps
=
angular
.
copy
(
scope
.
sourceApps
);
scope
.
cop
i
edApps
=
angular
.
copy
(
scope
.
sourceApps
);
},
function
(
result
)
{
},
function
(
result
)
{
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"load apps error"
);
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"load apps error"
);
});
});
...
@@ -36,12 +36,12 @@ directive_module.directive('apollonav',
...
@@ -36,12 +36,12 @@ directive_module.directive('apollonav',
};
};
scope
.
changeSearchKey
=
function
()
{
scope
.
changeSearchKey
=
function
()
{
scope
.
cop
y
edApps
=
[];
scope
.
cop
i
edApps
=
[];
var
searchKey
=
scope
.
searchKey
.
toLocaleLowerCase
();
var
searchKey
=
scope
.
searchKey
.
toLocaleLowerCase
();
scope
.
sourceApps
.
forEach
(
function
(
app
)
{
scope
.
sourceApps
.
forEach
(
function
(
app
)
{
if
(
app
.
name
.
toLocaleLowerCase
().
indexOf
(
searchKey
)
>
-
1
if
(
app
.
name
.
toLocaleLowerCase
().
indexOf
(
searchKey
)
>
-
1
||
app
.
appId
.
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
;
scope
.
shouldShowAppList
=
true
;
...
@@ -63,18 +63,18 @@ directive_module.directive('apollonav',
...
@@ -63,18 +63,18 @@ directive_module.directive('apollonav',
element
.
bind
(
"keydown keypress"
,
function
(
event
)
{
element
.
bind
(
"keydown keypress"
,
function
(
event
)
{
if
(
event
.
keyCode
==
40
)
{
if
(
event
.
keyCode
==
40
)
{
if
(
selectedAppIdx
<
scope
.
cop
y
edApps
.
length
-
1
)
{
if
(
selectedAppIdx
<
scope
.
cop
i
edApps
.
length
-
1
)
{
clearAppsSelectedStatus
();
clearAppsSelectedStatus
();
scope
.
cop
y
edApps
[
++
selectedAppIdx
].
selected
=
true
;
scope
.
cop
i
edApps
[
++
selectedAppIdx
].
selected
=
true
;
}
}
}
else
if
(
event
.
keyCode
==
38
)
{
}
else
if
(
event
.
keyCode
==
38
)
{
if
(
selectedAppIdx
>=
1
)
{
if
(
selectedAppIdx
>=
1
)
{
clearAppsSelectedStatus
();
clearAppsSelectedStatus
();
scope
.
cop
y
edApps
[
--
selectedAppIdx
].
selected
=
true
;
scope
.
cop
i
edApps
[
--
selectedAppIdx
].
selected
=
true
;
}
}
}
else
if
(
event
.
keyCode
==
13
)
{
}
else
if
(
event
.
keyCode
==
13
)
{
if
(
scope
.
shouldShowAppList
&&
selectedAppIdx
>
-
1
)
{
if
(
scope
.
shouldShowAppList
&&
selectedAppIdx
>
-
1
)
{
select
(
scope
.
cop
y
edApps
[
selectedAppIdx
]);
select
(
scope
.
cop
i
edApps
[
selectedAppIdx
]);
event
.
preventDefault
();
event
.
preventDefault
();
}
else
{
}
else
{
scope
.
jumpToConfigPage
();
scope
.
jumpToConfigPage
();
...
...
apollo-portal/src/main/resources/static/views/common/nav.html
View file @
2d058e43
...
@@ -53,7 +53,7 @@
...
@@ -53,7 +53,7 @@
ng-model=
"searchKey"
ng-change=
"changeSearchKey()"
ng-focus=
"changeSearchKey()"
>
ng-model=
"searchKey"
ng-change=
"changeSearchKey()"
ng-focus=
"changeSearchKey()"
>
<div
class=
"row app-list"
ng-show=
"shouldShowAppList"
>
<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}}
ng-click=
"selectApp(app)"
>
{{app.appId}} / {{app.name}}
</div>
</div>
</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