mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-05 18:38:09 +01:00
ui: Main price chart fixes/updates.
This commit is contained in:
@@ -1023,13 +1023,14 @@ const app = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
toggleAutoRefresh: () => {
|
toggleAutoRefresh: () => {
|
||||||
if (app.isAutoRefreshEnabled) {
|
if (app.isAutoRefreshEnabled) {
|
||||||
app.stopAutoRefresh();
|
app.stopAutoRefresh();
|
||||||
} else {
|
} else {
|
||||||
app.startAutoRefresh();
|
app.startAutoRefresh();
|
||||||
}
|
app.startSpinAnimation();
|
||||||
app.updateAutoRefreshButton();
|
}
|
||||||
},
|
app.updateAutoRefreshButton();
|
||||||
|
},
|
||||||
|
|
||||||
updateNextRefreshTime: () => {
|
updateNextRefreshTime: () => {
|
||||||
const nextRefreshSpan = document.getElementById('next-refresh-time');
|
const nextRefreshSpan = document.getElementById('next-refresh-time');
|
||||||
@@ -1061,27 +1062,37 @@ const app = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
updateAutoRefreshButton: () => {
|
updateAutoRefreshButton: () => {
|
||||||
const button = document.getElementById('toggle-auto-refresh');
|
const button = document.getElementById('toggle-auto-refresh');
|
||||||
if (button) {
|
if (button) {
|
||||||
if (app.isAutoRefreshEnabled) {
|
if (app.isAutoRefreshEnabled) {
|
||||||
button.classList.remove('text-gray-600', 'dark:text-gray-400');
|
button.classList.remove('text-gray-600', 'dark:text-gray-400');
|
||||||
button.classList.add('text-green-500', 'dark:text-green-400');
|
button.classList.add('text-green-500', 'dark:text-green-400');
|
||||||
} else {
|
app.startSpinAnimation();
|
||||||
button.classList.remove('text-green-500', 'dark:text-green-400');
|
} else {
|
||||||
button.classList.add('text-gray-600', 'dark:text-gray-400');
|
button.classList.remove('text-green-500', 'dark:text-green-400');
|
||||||
}
|
button.classList.add('text-gray-600', 'dark:text-gray-400');
|
||||||
button.title = app.isAutoRefreshEnabled ? 'Disable Auto-Refresh' : 'Enable Auto-Refresh';
|
app.stopSpinAnimation();
|
||||||
|
|
||||||
const svg = button.querySelector('svg');
|
|
||||||
if (svg) {
|
|
||||||
if (app.isAutoRefreshEnabled) {
|
|
||||||
svg.classList.add('animate-spin');
|
|
||||||
} else {
|
|
||||||
svg.classList.remove('animate-spin');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
button.title = app.isAutoRefreshEnabled ? 'Disable Auto-Refresh' : 'Enable Auto-Refresh';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
startSpinAnimation: () => {
|
||||||
|
const svg = document.querySelector('#toggle-auto-refresh svg');
|
||||||
|
if (svg) {
|
||||||
|
svg.classList.add('animate-spin');
|
||||||
|
setTimeout(() => {
|
||||||
|
svg.classList.remove('animate-spin');
|
||||||
|
}, 2000); // Remove the animation after 2 seconds
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
stopSpinAnimation: () => {
|
||||||
|
const svg = document.querySelector('#toggle-auto-refresh svg');
|
||||||
|
if (svg) {
|
||||||
|
svg.classList.remove('animate-spin');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
refreshAllData: async () => {
|
refreshAllData: async () => {
|
||||||
ui.showLoader();
|
ui.showLoader();
|
||||||
|
|||||||
Reference in New Issue
Block a user