(design) delete min-height

This commit is contained in:
kakkokari-gtyih 2023-04-06 09:11:35 +09:00
parent 67d24ab548
commit e4762b4b85
4 changed files with 58 additions and 37 deletions

View File

@ -11,6 +11,7 @@ import { url } from '@/config';
import { popout as popout_ } from '@/scripts/popout';
import { i18n } from '@/i18n';
import { useRouter } from '@/router';
import { MenuItem } from '@/types/menu';
const props = withDefaults(defineProps<{
to: string;
@ -33,37 +34,60 @@ const active = $computed(() => {
return resolved.route.name === router.currentRoute.value.name;
});
function onContextmenu(ev) {
function onContextmenu(ev : Event) {
const selection = window.getSelection();
if (selection && selection.toString() !== '') return;
os.contextMenu([{
type: 'label',
text: props.to,
}, {
icon: 'ti ti-app-window',
text: i18n.ts.openInWindow,
action: () => {
os.pageWindow(props.to);
},
}, {
icon: 'ti ti-player-eject',
text: i18n.ts.showInPage,
action: () => {
router.push(props.to, 'forcePage');
},
}, null, {
icon: 'ti ti-external-link',
text: i18n.ts.openInNewTab,
action: () => {
window.open(props.to, '_blank');
},
}, {
icon: 'ti ti-link',
text: i18n.ts.copyLink,
action: () => {
copyToClipboard(`${url}${props.to}`);
},
}], ev);
if ((selection && selection.toString() !== '')) return;
let contextMenuItem: MenuItem[] = [];
if (router.currentRoute.value.name?.toLowerCase().includes("embed")) {
contextMenuItem = [{
type: 'label',
text: props.to,
}, {
icon: 'ti ti-external-link',
text: i18n.ts.openInNewTab,
action: () => {
window.open(props.to, '_blank');
},
}, {
icon: 'ti ti-link',
text: i18n.ts.copyLink,
action: () => {
copyToClipboard(`${url}${props.to}`);
},
}];
} else {
contextMenuItem = [{
type: 'label',
text: props.to,
}, {
icon: 'ti ti-app-window',
text: i18n.ts.openInWindow,
action: () => {
os.pageWindow(props.to);
},
}, {
icon: 'ti ti-player-eject',
text: i18n.ts.showInPage,
action: () => {
router.push(props.to, 'forcePage');
},
}, null, {
icon: 'ti ti-external-link',
text: i18n.ts.openInNewTab,
action: () => {
window.open(props.to, '_blank');
},
}, {
icon: 'ti ti-link',
text: i18n.ts.copyLink,
action: () => {
copyToClipboard(`${url}${props.to}`);
},
}];
}
os.contextMenu(contextMenuItem, ev);
}
function openWindow() {

View File

@ -93,7 +93,9 @@ definePageMetadata(computed(() => note ? {
}
.fcuexfpr {
background: var(--bg);
border-radius: var(--radius);
border: 1px solid var(--divider);
background: var(--panel);
> .note {
height: 100%;

View File

@ -20,7 +20,7 @@ export function getEmbedCode(props: {
if (src !== undefined) {
const id = uuid();
return `<iframe src="${src}" title="Misskey Note" style="border:none; width:100%; max-width: 650px; min-height: 300px;" data-msky-embed="${id}"></iframe>
return `<iframe src="${src}" title="Misskey Embed" style="border:none; width:100%; max-width: 650px; min-height: 300px;" data-msky-embed="${id}"></iframe>
<script src="https://cdn.jsdelivr.net/npm/iframe-resizer@4.3.6/js/iframeResizer.min.js" integrity="sha256-86F9vrEnnd2apFWVo5sNxArab6T8L048fPPkYONBDHY=" crossorigin="anonymous"></script>
<script>iFrameResize({}, 'iframe[data-msky-embed="${id}"]');</script>`;
}

View File

@ -31,17 +31,12 @@ provideMetadataReceiver((info) => {
document.documentElement.style.backgroundColor = "transparent";
document.documentElement.style.maxWidth = "650px";
document.documentElement.style.minHeight = "300px";
</script>
<style lang="scss" scoped>
.mk-app {
max-width: 650px;
min-width: 0;
min-height: 300px;
overflow: hidden;
border-radius: var(--radius);
border: 1px solid var(--divider);
box-sizing: border-box;
background-color: transparent;
}