mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 23:51:09 -05:00
Restored to '20442f595c8df2c8347249ade7f015b7ae566474'
Replit-Restored-To: 20442f595c8df2c8347249ade7f015b7ae566474
This commit is contained in:
@@ -375,8 +375,6 @@ Alpine.data('authModal', (defaultMode = 'login') => ({
|
||||
this.resetForms();
|
||||
}
|
||||
});
|
||||
|
||||
// No need for event listeners since x-init handles global exposure
|
||||
},
|
||||
|
||||
async fetchSocialProviders() {
|
||||
@@ -620,44 +618,6 @@ Alpine.store('toast', {
|
||||
});
|
||||
|
||||
console.log('All Alpine.js components registered successfully');
|
||||
|
||||
// Ensure global authModal is available immediately
|
||||
if (typeof window !== 'undefined') {
|
||||
// Create a simple proxy that will find the authModal component when called
|
||||
window.authModal = {
|
||||
show: (mode = 'login') => {
|
||||
console.log('Attempting to show auth modal:', mode);
|
||||
|
||||
// Find the authModal component in the DOM
|
||||
const modalEl = document.querySelector('[x-data*="authModal"]');
|
||||
if (modalEl && modalEl._x_dataStack && modalEl._x_dataStack[0]) {
|
||||
const component = modalEl._x_dataStack[0];
|
||||
if (component.show && typeof component.show === 'function') {
|
||||
component.show(mode);
|
||||
console.log('Auth modal opened successfully');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback: try to find any component with a show method
|
||||
const elements = document.querySelectorAll('[x-data]');
|
||||
for (let el of elements) {
|
||||
if (el._x_dataStack) {
|
||||
for (let stack of el._x_dataStack) {
|
||||
if (stack.show && stack.mode !== undefined) {
|
||||
stack.show(mode);
|
||||
console.log('Auth modal opened via fallback method');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.error('Could not find authModal component to open');
|
||||
}
|
||||
};
|
||||
console.log('Global authModal proxy created');
|
||||
}
|
||||
}
|
||||
|
||||
// Try multiple registration approaches
|
||||
|
||||
Reference in New Issue
Block a user