summaryrefslogtreecommitdiff
path: root/packages/client/src
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2021-12-24 12:34:24 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2021-12-24 12:34:24 +0900
commitb4636631751449da34e2bad7e7276546c6fd3967 (patch)
tree10c93c4d3b3809a3ca1a9baf4484b838bfca5d84 /packages/client/src
parentfix(client): fix zindex issue (diff)
downloadsharkey-b4636631751449da34e2bad7e7276546c6fd3967.tar.gz
sharkey-b4636631751449da34e2bad7e7276546c6fd3967.tar.bz2
sharkey-b4636631751449da34e2bad7e7276546c6fd3967.zip
enhance(client): tweak ui
Diffstat (limited to 'packages/client/src')
-rw-r--r--packages/client/src/components/page-window.vue26
-rw-r--r--packages/client/src/components/ui/window.vue5
-rw-r--r--packages/client/src/scripts/use-tooltip.ts7
3 files changed, 35 insertions, 3 deletions
diff --git a/packages/client/src/components/page-window.vue b/packages/client/src/components/page-window.vue
index 39c185b3e0..ec7451d5aa 100644
--- a/packages/client/src/components/page-window.vue
+++ b/packages/client/src/components/page-window.vue
@@ -16,7 +16,13 @@
<template #headerLeft>
<button v-if="history.length > 0" v-tooltip="$ts.goBack" class="_button" @click="back()"><i class="fas fa-arrow-left"></i></button>
</template>
- <div class="yrolvcoq">
+ <template #headerRight>
+ <button v-tooltip="$ts.showInPage" class="_button" @click="expand()"><i class="fas fa-expand-alt"></i></button>
+ <button v-tooltip="$ts.popout" class="_button" @click="popout()"><i class="fas fa-external-link-alt"></i></button>
+ <button class="_button" @click="menu"><i class="fas fa-ellipsis-h"></i></button>
+ </template>
+
+ <div class="yrolvcoq" :style="{ background: pageInfo?.bg }">
<MkStickyContainer>
<template #header><MkHeader v-if="pageInfo && !pageInfo.hideHeader" :info="pageInfo"/></template>
<component :is="component" v-bind="props" :ref="changePage"/>
@@ -33,6 +39,7 @@ import copyToClipboard from '@/scripts/copy-to-clipboard';
import { resolve } from '@/router';
import { url } from '@/config';
import * as symbols from '@/symbols';
+import * as os from '@/os';
export default defineComponent({
components: {
@@ -139,6 +146,23 @@ export default defineComponent({
this.props = props;
},
+ menu(ev) {
+ os.popupMenu([{
+ icon: 'fas fa-external-link-alt',
+ text: this.$ts.openInNewTab,
+ action: () => {
+ window.open(this.url, '_blank');
+ this.$refs.window.close();
+ }
+ }, {
+ icon: 'fas fa-link',
+ text: this.$ts.copyLink,
+ action: () => {
+ copyToClipboard(this.url);
+ }
+ }], ev.currentTarget || ev.target);
+ },
+
back() {
this.navigate(this.history.pop(), false);
},
diff --git a/packages/client/src/components/ui/window.vue b/packages/client/src/components/ui/window.vue
index d01498d8df..bd33289ccc 100644
--- a/packages/client/src/components/ui/window.vue
+++ b/packages/client/src/components/ui/window.vue
@@ -414,6 +414,10 @@ export default defineComponent({
}
}
+ > .left {
+ min-width: 16px;
+ }
+
> .title {
flex: 1;
position: relative;
@@ -421,7 +425,6 @@ export default defineComponent({
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
- text-align: center;
cursor: move;
}
}
diff --git a/packages/client/src/scripts/use-tooltip.ts b/packages/client/src/scripts/use-tooltip.ts
index d0c6756eb1..bc8f27a038 100644
--- a/packages/client/src/scripts/use-tooltip.ts
+++ b/packages/client/src/scripts/use-tooltip.ts
@@ -1,4 +1,4 @@
-import { Ref, ref, watch } from 'vue';
+import { Ref, ref, watch, onUnmounted } from 'vue';
export function useTooltip(
elRef: Ref<HTMLElement | { $el: HTMLElement } | null | undefined>,
@@ -72,9 +72,14 @@ export function useTooltip(
el.addEventListener('mouseleave', onMouseleave, { passive: true });
el.addEventListener('touchstart', onTouchstart, { passive: true });
el.addEventListener('touchend', onTouchend, { passive: true });
+ el.addEventListener('click', close, { passive: true });
}
}, {
immediate: true,
flush: 'post',
});
+
+ onUnmounted(() => {
+ close();
+ });
}