mirror of
https://github.com/moodle/moodle.git
synced 2025-02-25 12:33:18 +01:00
MDL-82832 ddimageortext: center the dd item using js.
This commit is contained in:
parent
6cd55074c7
commit
c25554b93c
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -248,7 +248,11 @@ define([
|
||||
|
||||
// Set each drag home to that size.
|
||||
dragHomes.each(function(i, drag) {
|
||||
$(drag).width(maxWidth).height(maxHeight).css('lineHeight', maxHeight + 'px');
|
||||
const top = Math.floor((maxHeight - drag.offsetHeight) / 2);
|
||||
// Set top padding so the item is centred.
|
||||
$(drag).width(maxWidth).height(maxHeight).css({
|
||||
'padding-top': top + 'px',
|
||||
});
|
||||
});
|
||||
|
||||
// Create the drops and make them the right size.
|
||||
|
@ -85,7 +85,12 @@ form.mform fieldset#id_previewareaheader .droppreview {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.que.ddimageortext .MathJax_Display {
|
||||
/**
|
||||
* The position of mathjax element in ddimageortext is calculated by javascript in question.js line 254.
|
||||
* So we remove the default margin of Mathjax.
|
||||
*/
|
||||
.que.ddimageortext .MathJax_Display,
|
||||
.que.ddimageortext .MathJax_SVG_Display {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user