upd: update style of drawio

This commit is contained in:
purocean
2022-01-23 17:52:37 +08:00
parent 5164fec03d
commit 89bd5e3f45
+16 -4
View File
@@ -120,10 +120,7 @@ const Drawio = defineComponent({
h('div', { class: 'drawio-wrapper reduce-brightness', style: 'position: relative' }, [
h(
'div',
{
class: 'no-print',
style: 'position: absolute; right: 15px; top: 3px; z-index: 1;'
},
{ class: 'drawio-action no-print' },
[
button(t('drawio.fit-height'), resize),
button(t('reload'), reload),
@@ -424,6 +421,21 @@ export default {
register: ctx => {
ctx.markdown.registerPlugin(MarkdownItPlugin)
ctx.theme.addStyles(`
.markdown-view .markdown-body .drawio-wrapper .drawio-action {
position: absolute;
right: 15px;
top: 2px;
z-index: 1;
opacity: 0;
transition: opacity .2s;
}
.markdown-view .markdown-body .drawio-wrapper:hover .drawio-action {
opacity: 1;
}
`)
ctx.registerHook('TREE_NODE_SELECT', async ({ node }) => {
if (node.path.toLowerCase().includes('.drawio')) {
const { repo, path, name, type } = node