mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-33728 Ensure that chooser dialogues are centred vertically
This commit is contained in:
parent
60d3ff94db
commit
7db27680f8
1 changed files with 8 additions and 0 deletions
8
lib/yui/chooserdialogue/chooserdialogue.js
vendored
8
lib/yui/chooserdialogue/chooserdialogue.js
vendored
|
@ -152,6 +152,7 @@ YUI.add('moodle-core-chooserdialogue', function(Y) {
|
||||||
var bb = this.overlay.get('boundingBox');
|
var bb = this.overlay.get('boundingBox');
|
||||||
|
|
||||||
var winheight = bb.get('winHeight');
|
var winheight = bb.get('winHeight');
|
||||||
|
var winwidth = bb.get('winWidth');
|
||||||
var offsettop = 0;
|
var offsettop = 0;
|
||||||
|
|
||||||
// Try and set a sensible max-height -- this must be done before setting the top
|
// Try and set a sensible max-height -- this must be done before setting the top
|
||||||
|
@ -187,6 +188,13 @@ YUI.add('moodle-core-chooserdialogue', function(Y) {
|
||||||
// We need to set the height for the yui3-widget - can't work
|
// We need to set the height for the yui3-widget - can't work
|
||||||
// out what we're setting at present -- shoud be the boudingBox
|
// out what we're setting at present -- shoud be the boudingBox
|
||||||
bb.setStyle('top', dialoguetop + 'px');
|
bb.setStyle('top', dialoguetop + 'px');
|
||||||
|
|
||||||
|
// Calculate the left location of the chooser
|
||||||
|
// We don't set a minimum width in the same way as we do height as the width would be far lower than the
|
||||||
|
// optimal width for moodle anyway.
|
||||||
|
var dialoguewidth = bb.get('offsetWidth');
|
||||||
|
var dialogueleft = (winwidth - dialoguewidth) / 2;
|
||||||
|
bb.setStyle('left', dialogueleft + 'px');
|
||||||
},
|
},
|
||||||
|
|
||||||
handle_key_press : function(e) {
|
handle_key_press : function(e) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue