mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 03:10:42 -03:30
fixed search pagination url issue
This commit is contained in:
parent
4a4c55a75c
commit
f35fcf86e7
@ -71,7 +71,27 @@ export default
|
||||
|
||||
// if you're editing an object, make sure you're on the right
|
||||
// page to display the element you are editing
|
||||
if (scope.addedItem) {
|
||||
if (params.fromSearch) {
|
||||
var url = params.url;
|
||||
// for a search, we want to make sure to get the first page of
|
||||
// results
|
||||
if (url.indexOf("page=") > -1) {
|
||||
// if the url includes a page, remove that part
|
||||
var urlArr = url.split("page=");
|
||||
var afterPageUrlArr = urlArr[1].split("&");
|
||||
|
||||
if (afterPageUrlArr.length > 1) {
|
||||
// if there's stuff after the page part,
|
||||
// put that back in
|
||||
afterPageUrlArr.shift();
|
||||
url = urlArr[0] +
|
||||
afterPageUrlArr.join("&");
|
||||
} else {
|
||||
url = urlArr[0];
|
||||
}
|
||||
}
|
||||
getPage(url);
|
||||
} else if (scope.addedItem) {
|
||||
id = scope.addedItem + "";
|
||||
delete scope.addedItem;
|
||||
$rootScope.rowBeingEdited = id;
|
||||
|
||||
@ -72,7 +72,8 @@ export default ['$scope', 'Refresh', 'tagSearchService', '$stateParams',
|
||||
scope: listScope,
|
||||
set: set,
|
||||
iterator: iterator,
|
||||
url: url
|
||||
url: url,
|
||||
fromSearch: true
|
||||
});
|
||||
|
||||
listScope.$on('PostRefresh', function() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user