This commit is contained in:
Ilya Tregubov
2024-09-19 15:08:12 +08:00
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
+6 -19
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', 'icon'])
;
element.append(spinner);
}
};
$('body').on('click keypress', '[data-inplaceeditable] [data-inplaceeditablelink]', function(e) {
if (e.type === 'keypress' && e.keyCode !== 13) {
return;
+1 -1
View File
@@ -71,7 +71,7 @@ table {
}
}
.table-dynamic .loading-icon {
.table-dynamic > .loading-icon {
position: absolute;
left: calc(50% - 1.5rem);
top: 200px;
+2 -2
View File
@@ -35558,12 +35558,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;
+2 -2
View File
@@ -35558,12 +35558,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;