MDL-47353 gradereport_grader: Fix header offset logic for floating headers

This is necessary for themes with non-fixed navbars to work with the
grader report, otherwise headers will be hidden.

This issue is a part of the MDL-46658 Task.
This issue is a part of the MDL-25544 Epic.
This commit is contained in:
Dave Cooper 2014-10-03 12:12:57 +08:00 committed by Andrew Nicols
parent 6821f7310c
commit 3d8ef7c65d
5 changed files with 24 additions and 3 deletions

View File

@ -485,6 +485,13 @@ FloatingHeaders.prototype = {
if (header) {
if (header.getComputedStyle('position') === 'fixed') {
this.pageHeaderHeight = header.get(OFFSETHEIGHT);
} else {
var navbar = Y.one('.navbar');
if (navbar) {
// If the navbar exists and isn't fixed, we need to offset the page header to accommodate for it.
this.pageHeaderHeight = navbar.get(OFFSETHEIGHT);
}
}
}
},

View File

@ -485,6 +485,13 @@ FloatingHeaders.prototype = {
if (header) {
if (header.getComputedStyle('position') === 'fixed') {
this.pageHeaderHeight = header.get(OFFSETHEIGHT);
} else {
var navbar = Y.one('.navbar');
if (navbar) {
// If the navbar exists and isn't fixed, we need to offset the page header to accommodate for it.
this.pageHeaderHeight = navbar.get(OFFSETHEIGHT);
}
}
}
},

View File

@ -342,6 +342,13 @@ FloatingHeaders.prototype = {
if (header) {
if (header.getComputedStyle('position') === 'fixed') {
this.pageHeaderHeight = header.get(OFFSETHEIGHT);
} else {
var navbar = Y.one('.navbar');
if (navbar) {
// If the navbar exists and isn't fixed, we need to offset the page header to accommodate for it.
this.pageHeaderHeight = navbar.get(OFFSETHEIGHT);
}
}
}
},

View File

@ -11,7 +11,7 @@ information provided here is intended especially for theme designer.
* On calendar view screen the course selector and new event button have been swapped, custom CSS for .path-calendar might be affected.
* The functions search_listing() and search_pagination() in the core_course_management_renderer class take the searched string
as an extra parameter - see MDL-46902.
* Themes with non-fixed headers must have the .navbar class in their navbar in order for floating headers in the grader report to work - see MDL-46658.
=== 2.7 ===