1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-07 09:23:31 +02:00

Merge branch 'MDL-72963-master' of git://github.com/ferranrecio/moodle

This commit is contained in:
Shamim Rezaie 2021-11-03 18:14:03 +11:00
commit d11e20a523
3 changed files with 18 additions and 2 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -135,9 +135,19 @@ define(
el.removeAttr('data-oldcontent');
el.removeClass('inplaceeditingon');
el.find('[data-inplaceeditablelink]').focus();
// Re-enable any parent draggable attribute.
el.parents(`[data-inplace-in-draggable="true"]`)
.attr('draggable', true)
.attr('data-inplace-in-draggable', false);
};
var turnEditingOffEverywhere = function() {
// Re-enable any disabled draggable attribute.
$(`[data-inplace-in-draggable="true"]`)
.attr('draggable', true)
.attr('data-inplace-in-draggable', false);
$('span.inplaceeditable.inplaceeditingon').each(function() {
turnEditingOff($(this));
});
@ -324,6 +334,12 @@ define(
var type = el.attr('data-type');
var options = el.attr('data-options');
// Input text inside draggable elements disable text selection in some browsers.
// To prevent this we temporally disable any parent draggables.
el.parents('[draggable="true"]')
.attr('data-inplace-in-draggable', true)
.attr('draggable', false);
if (type === 'toggle') {
turnEditingOnToggle(el, options);
} else if (type === 'select') {