Merge branch 'MDL-82909-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE

This commit is contained in:
Ilya Tregubov 2024-09-19 15:08:32 +08:00
commit 003d6ee817
6 changed files with 13 additions and 26 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -36,14 +36,14 @@ define(
'core/config',
'core/url',
'core/form-autocomplete',
'core/loadingicon',
'core/pending',
'core/local/inplace_editable/events',
],
function($, ajax, templates, notification, str, cfg, url, autocomplete, Pending, Events) {
function($, ajax, templates, notification, str, cfg, url, autocomplete, LoadingIcon, Pending, Events) {
const removeSpinner = function(element) {
element.removeClass('updating');
element.find('img.spinner').hide();
element.find('.loading-icon').hide();
};
/**
@ -61,9 +61,10 @@ define(
mainelement.attr('data-component'),
mainelement.attr('data-itemtype'),
].join('-');
var pendingPromise = new Pending(pendingId);
addSpinner(mainelement);
var pendingPromise = new Pending(pendingId);
LoadingIcon.addIconToContainerRemoveOnCompletion(mainelement, pendingPromise);
ajax.call([{
methodname: 'core_update_inplace_editable',
args: {
@ -104,20 +105,6 @@ define(
});
};
const addSpinner = function(element) {
element.addClass('updating');
var spinner = element.find('img.spinner');
if (spinner.length) {
spinner.show();
} else {
spinner = $('<img/>')
.attr('src', url.imageUrl('i/loading_small'))
.addClass('spinner').addClass('smallicon')
;
element.append(spinner);
}
};
$('body').on('click keypress', '[data-inplaceeditable] [data-inplaceeditablelink]', function(e) {
if (e.type === 'keypress' && e.keyCode !== 13) {
return;

View File

@ -71,7 +71,7 @@ table {
}
}
.table-dynamic .loading-icon {
.table-dynamic > .loading-icon {
position: absolute;
left: calc(50% - 1.5rem);
top: 200px;

View File

@ -35125,12 +35125,12 @@ table .sticky-column {
background-color: inherit;
}
.table-dynamic .loading-icon {
.table-dynamic > .loading-icon {
position: absolute;
left: calc(50% - 1.5rem);
top: 200px;
}
.table-dynamic .loading-icon .icon {
.table-dynamic > .loading-icon .icon {
max-height: 3rem;
max-width: 3rem;
font-size: 3rem;

View File

@ -35125,12 +35125,12 @@ table .sticky-column {
background-color: inherit;
}
.table-dynamic .loading-icon {
.table-dynamic > .loading-icon {
position: absolute;
left: calc(50% - 1.5rem);
top: 200px;
}
.table-dynamic .loading-icon .icon {
.table-dynamic > .loading-icon .icon {
max-height: 3rem;
max-width: 3rem;
font-size: 3rem;