mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
MDL-72963 core: fix inplace editable in draggable elements
This commit is contained in:
parent
b16fc54103
commit
da0296a948
2
lib/amd/build/inplace_editable.min.js
vendored
2
lib/amd/build/inplace_editable.min.js
vendored
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') {
|
||||
|
Loading…
x
Reference in New Issue
Block a user