Bug fixes. Style setting improvements.
This commit is contained in:
@@ -26,15 +26,39 @@ type key_val = {
|
||||
};
|
||||
|
||||
// Editing
|
||||
const modalComponentEditSponsorshipObj: ModalComponent = { ref: Edit_modal_sponsorship_obj };
|
||||
const modalComponentEditSponsorshipObj: ModalComponent = { ref: Edit_modal_sponsorship_obj, props: {container_class_li: 'w-full p-4 space-y-4 card'} };
|
||||
|
||||
const modal_edit__sponsorship_obj: ModalSettings = {
|
||||
type: 'component',
|
||||
component: modalComponentEditSponsorshipObj,
|
||||
title: 'Edit Your Sponsorship',
|
||||
position: '', // default is "items-center"
|
||||
|
||||
response: (r: boolean | undefined) => handle_modal_close(r)
|
||||
};
|
||||
|
||||
function handle_modal_close(response: boolean | undefined) {
|
||||
console.log('Modal closed. Response:', response);
|
||||
|
||||
let location = window.location.href;
|
||||
const url = new URL(location);
|
||||
url.searchParams.delete('sponsorship_id');
|
||||
history.pushState({}, '', url);
|
||||
|
||||
let message = {'sponsorship_id': null};
|
||||
window.parent.postMessage(message, "*");
|
||||
// console.log('Message sent to parent (iframe):', message);
|
||||
}
|
||||
|
||||
if ($slct_trigger == 'msg_parent' && $slct.sponsorship_cfg_id) {
|
||||
console.log(`Message parent with sponsorship_cfg_id ${$slct.sponsorship_cfg_id}`);
|
||||
$slct_trigger = null
|
||||
|
||||
let message = {'sponsorship_cfg_id': $slct.sponsorship_cfg_id};
|
||||
window.parent.postMessage(message, "*");
|
||||
// console.log('Message sent to parent (iframe):', message);
|
||||
}
|
||||
|
||||
$ae_loc.hostname = data.url.hostname;
|
||||
$ae_loc.site_domain = data.url.origin;
|
||||
|
||||
@@ -112,7 +136,8 @@ async function handle_load_ae_obj_id__sponsorship_cfg({sponsorship_cfg_id, try_c
|
||||
|
||||
|
||||
// Load the Sponsorship Obj with ID based on the URL param.
|
||||
$slct.sponsorship_id = data.url.searchParams.get('ae_id');
|
||||
// $slct.sponsorship_id = data.url.searchParams.get('ae_id');
|
||||
$slct.sponsorship_id = data.url.searchParams.get('sponsorship_id');
|
||||
$slct_trigger = 'load__sponsorship_obj';
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user