mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 14:57:39 -02:30
Added custom scroll bar to inventory groups container. Moved group container auto-resize and height calc function to helper methods. Now using full window height, pushing footer off the page. Changed custom sroll directive to use the dark-thin theme.
This commit is contained in:
@@ -14,26 +14,31 @@ angular.module('InventoryHelper', ['RestServices', 'Utilities', 'OrganizationLis
|
||||
'InventoryHelper', 'InventoryFormDefinition', 'ParseHelper', 'SearchHelper', 'VariablesHelper',
|
||||
])
|
||||
|
||||
.factory('WatchInventoryWindowResize', ['ApplyEllipsis',
|
||||
function (ApplyEllipsis) {
|
||||
.factory('GetContainerHeight', [ function() {
|
||||
return function() {
|
||||
return $(window).height() - $('.main-menu').outerHeight() - $('#main_tabs').outerHeight() - $('#breadcrumbs').outerHeight() -
|
||||
$('.site-footer').outerHeight() - $('#groups-container .list-actions').outerHeight() - $('#groups-table-header').height() - 15;
|
||||
};
|
||||
}])
|
||||
|
||||
.factory('SetGroupContainerHeight', [ 'GetContainerHeight', function(GetContainerHeight) {
|
||||
return function() {
|
||||
var height;
|
||||
if ($(window).width() > 1210) {
|
||||
height = GetContainerHeight();
|
||||
$('#groups-container .list-table-container').height(height);
|
||||
}
|
||||
else {
|
||||
$('#groups-container .list-table-container').height('auto');
|
||||
}
|
||||
$('#groups-container .list-table-container').mCustomScrollbar("update");
|
||||
};
|
||||
}])
|
||||
.factory('WatchInventoryWindowResize', ['ApplyEllipsis', 'SetGroupContainerHeight',
|
||||
function (ApplyEllipsis, SetGroupContainerHeight) {
|
||||
return function () {
|
||||
// Call to set or restore window resize
|
||||
|
||||
function setGroupsHeight() {
|
||||
// Attempt to set the group height
|
||||
var height;
|
||||
if ($(window).width() > 1210) {
|
||||
height = $(window).height() - $('.main-menu').outerHeight() - $('#main_tabs').outerHeight() - $('#breadcrumbs').outerHeight() -
|
||||
($('.site-footer').outerHeight() * 2) - $('#groups-container .list-actions').outerHeight() - $('#groups-table-header').height() - 20;
|
||||
$('#groups-container .list-table-container').height(height);
|
||||
}
|
||||
else {
|
||||
$('#groups-container .list-table-container').height('auto');
|
||||
}
|
||||
}
|
||||
|
||||
setGroupsHeight();
|
||||
|
||||
SetGroupContainerHeight();
|
||||
$(window).resize(_.debounce(function() {
|
||||
// Hack to stop group-name div slipping to a new line
|
||||
$('#groups_table .name-column').each(function () {
|
||||
@@ -46,7 +51,7 @@ angular.module('InventoryHelper', ['RestServices', 'Utilities', 'OrganizationLis
|
||||
});
|
||||
ApplyEllipsis('#groups_table .group-name a');
|
||||
ApplyEllipsis('#hosts_table .host-name a');
|
||||
setGroupsHeight();
|
||||
SetGroupContainerHeight();
|
||||
}, 500));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ angular.module('InventoryGroupsDefinition', [])
|
||||
hasChildren: true,
|
||||
filterBy: '{ show: true }',
|
||||
'class': 'table-no-border',
|
||||
awCustomScroll: true,
|
||||
|
||||
fields: {
|
||||
name: {
|
||||
@@ -64,6 +65,7 @@ angular.module('InventoryGroupsDefinition', [])
|
||||
fieldActions: {
|
||||
|
||||
columnClass: 'col-lg-2 col-md-2 col-sm-2 col-xs-3',
|
||||
label: false,
|
||||
|
||||
sync_status: {
|
||||
mode: 'all',
|
||||
|
||||
@@ -729,7 +729,7 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Job
|
||||
scrollButtons: {
|
||||
enable: true
|
||||
},
|
||||
theme: 'dark-thick',
|
||||
theme: 'dark-thin',
|
||||
mouseWheel: true,
|
||||
scrollInertia: 300,
|
||||
callbacks: {
|
||||
|
||||
@@ -287,7 +287,9 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
|
||||
}
|
||||
|
||||
// table header row
|
||||
html += "<div class=\"list-table-container\">\n";
|
||||
html += "<div class=\"list-table-container\"";
|
||||
html += (list.awCustomScroll) ? " aw-custom-scroll " : "";
|
||||
html += ">\n";
|
||||
html += "<table id=\"" + list.name + "_table\" ";
|
||||
html += "class=\"table table-condensed";
|
||||
html += (list['class']) ? " " + list['class'] : "";
|
||||
@@ -473,7 +475,8 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
|
||||
}
|
||||
if (options.mode === 'select' || options.mode === 'lookup') {
|
||||
html += "<th>Select</th>";
|
||||
} else if (options.mode === 'edit' && list.fieldActions) {
|
||||
} else if (options.mode === 'edit' && list.fieldActions &&
|
||||
(list.fieldActions.label === undefined || list.fieldActions.label)) {
|
||||
html += "<th class=\"actions-column";
|
||||
html += (list.fieldActions && list.fieldActions.columnClass) ? " " + list.fieldActions.columnClass : "";
|
||||
html += "\">Actions</th>\n";
|
||||
|
||||
Reference in New Issue
Block a user