Revert "Merge pull request #16 from paperboygold/main"

This reverts commit c1b2520fa1, reversing
changes made to c6a1352aae.
This commit is contained in:
Spicy_Marinara
2025-10-22 00:52:43 +02:00
parent afd6f81580
commit 83576a9073
6 changed files with 21 additions and 405 deletions
+3 -35
View File
@@ -98,8 +98,7 @@ import {
setupMobileTabs,
removeMobileTabs,
setupMobileKeyboardHandling,
setupContentEditableScrolling,
setupRefreshButtonDrag
setupContentEditableScrolling
} from './src/systems/ui/mobile.js';
import {
setupDesktopTabs,
@@ -210,14 +209,6 @@ async function initUI() {
`;
$('body').append(mobileToggleHtml);
// Add mobile refresh button (same pattern as toggle button)
const mobileRefreshHtml = `
<button id="rpg-manual-update-mobile" class="rpg-mobile-refresh" title="Refresh RPG Info">
<i class="fa-solid fa-sync"></i>
</button>
`;
$('body').append(mobileRefreshHtml);
// Cache UI elements using state setters
setPanelContainer($('#rpg-companion-panel'));
setUserStatsContainer($('#rpg-user-stats'));
@@ -306,34 +297,12 @@ async function initUI() {
toggleAnimations();
});
// Bind to both desktop and mobile refresh buttons
$('#rpg-manual-update, #rpg-manual-update-mobile').on('click', async function() {
// Get mobile button reference
const $mobileBtn = $('#rpg-manual-update-mobile');
// Skip if we just finished dragging the mobile button
if ($mobileBtn.data('just-dragged')) {
console.log('[RPG Companion] Click blocked - just finished dragging refresh button');
return;
}
$('#rpg-manual-update').on('click', async function() {
if (!extensionSettings.enabled) {
// console.log('[RPG Companion] Extension is disabled. Please enable it in the Extensions tab.');
return;
}
// Remove focus to prevent sticky black state on mobile
$(this).blur();
// Add spinning animation to mobile button
$mobileBtn.addClass('spinning');
try {
await updateRPGData(renderUserStats, renderInfoBox, renderThoughts, renderInventory);
} finally {
// Remove spinning animation when done
$mobileBtn.removeClass('spinning');
}
await updateRPGData(renderUserStats, renderInfoBox, renderThoughts, renderInventory);
});
$('#rpg-stat-bar-color-low').on('change', function() {
@@ -453,7 +422,6 @@ async function initUI() {
setupPlotButtons(sendPlotProgression);
setupMobileKeyboardHandling();
setupContentEditableScrolling();
setupRefreshButtonDrag();
initInventoryEventListeners();
}