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
c57a690b
Commit
c57a690b
authored
Oct 12, 2016
by
Jason Song
Committed by
GitHub
Oct 12, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #429 from lepdou/index_page_refactor
optimize not reload page when delete favorite app
parents
a4c3f278
4edcb169
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
IndexController.js
...in/resources/static/scripts/controller/IndexController.js
+14
-6
ConfigBaseInfoController.js
...tic/scripts/controller/config/ConfigBaseInfoController.js
+1
-1
No files found.
apollo-portal/src/main/resources/static/scripts/controller/IndexController.js
View file @
c57a690b
...
...
@@ -93,7 +93,14 @@ function IndexController($scope, $window, toastr, AppUtil, AppService, UserServi
if
(
userVisitedApps
&&
userVisitedApps
.
length
>
0
)
{
AppService
.
find_apps
(
userVisitedApps
.
join
(
","
))
.
then
(
function
(
apps
)
{
//sort
var
appIdMapApp
=
{};
apps
.
forEach
(
function
(
app
)
{
appIdMapApp
[
app
.
appId
]
=
app
;
});
userVisitedApps
.
forEach
(
function
(
appId
)
{
var
app
=
appIdMapApp
[
appId
];
$scope
.
visitedApps
.
push
(
app
);
});
});
...
...
@@ -116,7 +123,7 @@ function IndexController($scope, $window, toastr, AppUtil, AppService, UserServi
function
toTop
(
favoriteId
)
{
FavoriteService
.
toTop
(
favoriteId
).
then
(
function
()
{
toastr
.
success
(
"置顶成功"
);
re
load
();
re
freshFavorites
();
})
}
...
...
@@ -124,15 +131,16 @@ function IndexController($scope, $window, toastr, AppUtil, AppService, UserServi
function
deleteFavorite
(
favoriteId
)
{
FavoriteService
.
deleteFavorite
(
favoriteId
).
then
(
function
()
{
toastr
.
success
(
"取消收藏成功"
);
re
load
();
re
freshFavorites
();
})
}
function
re
load
()
{
setTimeout
(
function
()
{
$window
.
location
.
reload
()
;
},
500
)
;
function
re
freshFavorites
()
{
$scope
.
favoritesPage
=
0
;
$scope
.
favorites
=
[]
;
$scope
.
hasMoreFavorites
=
true
;
getUserFavorites
();
}
}
apollo-portal/src/main/resources/static/scripts/controller/config/ConfigBaseInfoController.js
View file @
c57a690b
...
...
@@ -61,7 +61,7 @@ function ConfigBaseInfoController($rootScope, $scope, $location, toastr, UserSer
if
(
currentUserVisitedApps
.
length
>=
6
){
currentUserVisitedApps
.
splice
(
0
,
1
);
}
visitedAppsObject
[
$rootScope
.
pageContext
.
userId
]
.
push
(
$rootScope
.
pageContext
.
appId
);
currentUserVisitedApps
.
push
(
$rootScope
.
pageContext
.
appId
);
localStorage
.
setItem
(
VISITED_APPS_STORAGE_KEY
,
JSON
.
stringify
(
visitedAppsObject
));
...
...
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