Release 2.9.0
This commit is contained in:
@@ -610,7 +610,7 @@
|
||||
} catch (_error) {
|
||||
actionPath = String(form.action || '');
|
||||
}
|
||||
var shouldReloadAfterSuccess = /^\/announcements\/\d+\/(?:play|stop)$/.test(actionPath);
|
||||
var shouldReloadAfterSuccess = /^\/announcements\/\d+\/(?:play|stop)$/.test(actionPath) || /^\/data-sources\/(?:api-sources|rss-feeds|weather)\/\d+$/.test(actionPath);
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
@@ -799,6 +799,28 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var refreshButton = target.closest('[data-manual-refresh-url]');
|
||||
if (refreshButton) {
|
||||
event.preventDefault();
|
||||
if (refreshButton.disabled) {
|
||||
return;
|
||||
}
|
||||
refreshButton.disabled = true;
|
||||
fetch(refreshButton.getAttribute('data-manual-refresh-url'), {
|
||||
method: 'POST',
|
||||
credentials: 'same-origin',
|
||||
headers: { 'X-Requested-With': 'XMLHttpRequest' }
|
||||
}).then(function (response) {
|
||||
if (!response.ok) {
|
||||
throw new Error('Refresh failed');
|
||||
}
|
||||
window.location.assign(response.url);
|
||||
}).catch(function () {
|
||||
refreshButton.disabled = false;
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
var button = target.closest('button[name="save_action"], button[name="action"]');
|
||||
if (!button) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user