mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
MDL-37566 AJAX Fix issues with minimum height and centring
This commit is contained in:
parent
ef5a82104c
commit
c5f609428d
1 changed files with 17 additions and 1 deletions
18
lib/yui/chooserdialogue/chooserdialogue.js
vendored
18
lib/yui/chooserdialogue/chooserdialogue.js
vendored
|
@ -241,8 +241,21 @@ YUI.add('moodle-core-chooserdialogue', function(Y) {
|
||||||
newheight = newheight - (15 + 15 + 40 + 40);
|
newheight = newheight - (15 + 15 + 40 + 40);
|
||||||
dialogue.setStyle('maxHeight', newheight + 'px');
|
dialogue.setStyle('maxHeight', newheight + 'px');
|
||||||
|
|
||||||
|
dialogueheight = bb.getStyle('height');
|
||||||
|
if (dialogueheight.match(/.*px$/)) {
|
||||||
|
dialogueheight = dialogueheight.replace(/px$/, '');
|
||||||
|
} else {
|
||||||
|
dialogueheight = totalheight;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dialogueheight < this.get('baseheight')) {
|
||||||
|
dialogueheight = this.get('baseheight');
|
||||||
|
dialogue.setStyle('height', dialogueheight + 'px');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Re-calculate the location now that we've changed the size
|
// Re-calculate the location now that we've changed the size
|
||||||
dialoguetop = Math.max(12, ((winheight - totalheight) / 2)) + offsettop;
|
dialoguetop = Math.max(12, ((winheight - dialogueheight) / 2)) + offsettop;
|
||||||
|
|
||||||
// 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
|
||||||
|
@ -314,6 +327,9 @@ YUI.add('moodle-core-chooserdialogue', function(Y) {
|
||||||
minheight : {
|
minheight : {
|
||||||
value : 300
|
value : 300
|
||||||
},
|
},
|
||||||
|
baseheight: {
|
||||||
|
value : 400
|
||||||
|
},
|
||||||
maxheight : {
|
maxheight : {
|
||||||
value : 660
|
value : 660
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue