fixed popup window for phone

This commit is contained in:
defnax 2026-08-15 16:37:58 +02:00
parent a2352e2963
commit fceefc95bb
4 changed files with 43 additions and 5 deletions

View File

@ -66,7 +66,7 @@ const ConfirmCopied = () => {
'p[style="margin: 4px 0 12px"]',
'Now, you can paste and send it to your friend via email or some other way.'
),
m('button', {}, 'Ok'),
m('button', { onclick: widget.closePopupMessage }, 'Ok'),
],
};
};
@ -97,7 +97,7 @@ const retroshareId = () => {
onclick: () => {
document.getElementById('retroId').select();
document.execCommand('copy');
widget.popupMessage(m(ConfirmCopied));
widget.popupMessage(m(ConfirmCopied), 'copy-confirmation-modal');
},
}),
m('i.fas.fa-share-alt'),

View File

@ -180,6 +180,37 @@
}
}
.modal-content.copy-confirmation-modal {
width: min(28rem, calc(100% - 2rem));
min-height: 0;
box-sizing: border-box;
h3 {
margin: 0 3rem 0.75rem 0;
font-size: 1.5rem;
}
p {
line-height: 1.5;
}
}
@media (max-width: 600px) {
.modal-content.copy-confirmation-modal {
width: calc(100% - 1rem);
max-height: calc(100% - 1rem);
padding: 1rem;
h3 {
font-size: 1.25rem;
}
button:last-child {
width: 100%;
}
}
}
.add-friend-wizard {
width: 100%;
min-width: 0;

View File

@ -78,6 +78,13 @@ const SidebarQuickView = () => {
// There are ways of doing this inside m.route but it is probably
// cleaner and faster when kept outside of the main auto
// rendering system
function closePopupMessage() {
const container = document.getElementById('modal-container');
if (!container) return;
m.mount(container, null);
container.style.display = 'none';
}
function popupMessage(message, modalClass = '') {
const container = document.getElementById('modal-container');
container.style.display = 'block';
@ -105,8 +112,7 @@ function popupMessage(message, modalClass = '') {
'button.red.close-btn',
{
onclick: () => {
m.mount(container, null);
container.style.display = 'none';
closePopupMessage();
},
},
m('i.fas.fa-times')
@ -122,4 +128,5 @@ module.exports = {
Sidebar,
SidebarQuickView,
popupMessage,
closePopupMessage,
};

File diff suppressed because one or more lines are too long