mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-70248 qtype_ddimageortext: Drop zones have UI issue in Editing form
This commit is contained in:
parent
6ef4e66f03
commit
a03b08abaf
4 changed files with 6 additions and 6 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -211,7 +211,7 @@ define(['jquery', 'core/dragdrop'], function($, dragDrop) {
|
||||||
|
|
||||||
// Resize them to the same size.
|
// Resize them to the same size.
|
||||||
$('.dropzones .droppreview').css('padding', '0');
|
$('.dropzones .droppreview').css('padding', '0');
|
||||||
var numGroups = $('select.draggroup').first().find('option').length;
|
var numGroups = $('.draggroup select').first().find('option').length;
|
||||||
for (var group = 1; group <= numGroups; group++) {
|
for (var group = 1; group <= numGroups; group++) {
|
||||||
dragDropToImageForm.resizeAllDragsAndDropsInGroup(group);
|
dragDropToImageForm.resizeAllDragsAndDropsInGroup(group);
|
||||||
}
|
}
|
||||||
|
@ -398,9 +398,8 @@ define(['jquery', 'core/dragdrop'], function($, dragDrop) {
|
||||||
top = Math.round(dropPosition.top - backgroundPosition.top);
|
top = Math.round(dropPosition.top - backgroundPosition.top);
|
||||||
|
|
||||||
// Constrain coordinates to be inside the background.
|
// Constrain coordinates to be inside the background.
|
||||||
// The -10 here matches the +10 in resizeAllDragsAndDropsInGroup().
|
left = Math.round(Math.max(0, Math.min(left, backgroundImage.outerWidth() - drop.outerWidth())));
|
||||||
left = Math.max(0, Math.min(left, backgroundImage.width() - drop.width() - 10));
|
top = Math.round(Math.max(0, Math.min(top, backgroundImage.outerHeight() - drop.outerHeight())));
|
||||||
top = Math.max(0, Math.min(top, backgroundImage.height() - drop.height() - 10));
|
|
||||||
|
|
||||||
// Update the form.
|
// Update the form.
|
||||||
dragDropToImageForm.form.setFormValue('drops', [dropNo, 'xleft'], left);
|
dragDropToImageForm.form.setFormValue('drops', [dropNo, 'xleft'], left);
|
||||||
|
|
|
@ -99,6 +99,7 @@ form.mform fieldset#id_previewareaheader .dragitems {
|
||||||
form.mform fieldset#id_previewareaheader .droppreview {
|
form.mform fieldset#id_previewareaheader .droppreview {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
cursor: move;
|
cursor: move;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.que.ddimageortext .dragitems.readonly .drag {
|
.que.ddimageortext .dragitems.readonly .drag {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue