Removed the resize logic that was attempting to control the number of rows show on the jobs list.

This commit is contained in:
Michael Abashian 2016-06-09 11:27:48 -04:00
parent 7533cc98d0
commit 22ea2fc344
3 changed files with 5 additions and 53 deletions

View File

@ -20,8 +20,7 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $statePa
var jobs_scope, scheduled_scope,
choicesCount = 0,
listCount = 0,
api_complete = false,
max_rows;
api_complete = false;
$scope.jobsSelected = true;
@ -68,7 +67,6 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $statePa
list: AllJobsList,
id: 'active-jobs',
url: GetBasePath('unified_jobs') + '?status__in=pending,waiting,running,completed,failed,successful,error,canceled',
pageSize: max_rows,
searchParams: search_params,
spinner: false
});
@ -81,8 +79,7 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $statePa
list: ScheduledJobsList,
id: 'scheduled-jobs-tab',
searchSize: 'col-lg-4 col-md-4 col-sm-4 col-xs-12',
url: GetBasePath('schedules') + '?next_run__isnull=false',
pageSize: max_rows
url: GetBasePath('schedules') + '?next_run__isnull=false'
});
$scope.refreshJobs = function() {
@ -121,10 +118,6 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $statePa
scheduled_scope.search('schedule');
}
});
$(window).resize(_.debounce(function() {
resizeContainers();
}, 500));
});
if ($scope.removeChoicesReady) {
@ -133,7 +126,6 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $statePa
$scope.removeChoicesReady = $scope.$on('choicesReady', function() {
choicesCount++;
if (choicesCount === 2) {
setHeight();
$scope.$emit('buildJobsList');
}
});
@ -155,46 +147,6 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $statePa
variable: 'type_choices',
callback: 'choicesReady'
});
// Set the height of each container and calc max number of rows containers can hold
function setHeight() {
var docw = $(window).width(),
//doch = $(window).height(),
available_height,
search_row, page_row, height, header, row_height;
$log.debug('docw: ' + docw);
// customize the container height and # of rows based on available viewport height
available_height = $(window).height() - $('#main-menu-container .navbar').outerHeight() - 80;
if (docw < 1350) {
available_height = (available_height < 800) ? 800 : available_height;
} else {
available_height = (available_height < 550) ? 550 : available_height;
}
$log.debug('available_height: ' + available_height);
$('.jobs-list-container').each(function() {
$(this).height(Math.floor(available_height));
});
search_row = Math.max($('.search-row:eq(0)').outerHeight(), 50);
page_row = Math.max($('.page-row:eq(0)').outerHeight(), 33);
header = Math.max($('#active_jobs_table thead').height(), 24);
height = Math.floor(available_height ) - header - page_row - search_row - 30;
row_height = 44;
max_rows = Math.floor(height / row_height);
max_rows = (max_rows < 5) ? 5 : max_rows;
$log.debug('max_rows: ' + max_rows);
}
// Set container height and return the number of allowed rows
function resizeContainers() {
setHeight();
jobs_scope[AllJobsList.iterator + '_page_size'] = max_rows;
jobs_scope.changePageSize(AllJobsList.name, AllJobsList.iterator);
scheduled_scope[ScheduledJobsList.iterator + '_page_size'] = max_rows;
scheduled_scope.changePageSize(ScheduledJobsList.name, ScheduledJobsList.iterator);
}
}
JobsListController.$inject = ['$rootScope', '$log', '$scope', '$compile', '$stateParams',

View File

@ -156,7 +156,7 @@ export default
};
}
])
.factory('JobsListUpdate', ['Rest', function(Rest) {
return function(params) {
var scope = params.scope,
@ -237,7 +237,7 @@ export default
list = params.list,
id = params.id,
url = params.url,
pageSize = params.pageSize || 5,
pageSize = params.pageSize || 10,
base = $location.path().replace(/^\//, '').split('/')[0],
search_params = params.searchParams,
spinner = (params.spinner === undefined) ? true : params.spinner, key;

View File

@ -641,7 +641,7 @@ export default
id = params.id,
url = params.url,
searchSize = params.searchSize,
pageSize = params.pageSize || 5,
pageSize = params.pageSize || 10,
spinner = (params.spinner === undefined) ? true : params.spinner;