From 7a5a541a4ed2ecd607b9e4545bcd192bcf381f17 Mon Sep 17 00:00:00 2001
From: syuilo <syuilotan@yahoo.co.jp>
Date: Tue, 3 Nov 2020 10:06:19 +0900
Subject: 相対パスでコピーされるのを修正
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/client/ui/default.side.vue | 29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

(limited to 'src/client/ui/default.side.vue')

diff --git a/src/client/ui/default.side.vue b/src/client/ui/default.side.vue
index cff35f6ed3..73f6cb92f4 100644
--- a/src/client/ui/default.side.vue
+++ b/src/client/ui/default.side.vue
@@ -19,6 +19,7 @@ import XHeader from './_common_/header.vue';
 import * as os from '@/os';
 import copyToClipboard from '@/scripts/copy-to-clipboard';
 import { resolve } from '@/router';
+import { url } from '@/config';
 
 export default defineComponent({
 	components: {
@@ -27,15 +28,15 @@ export default defineComponent({
 
 	provide() {
 		return {
-			navHook: (url) => {
-				this.navigate(url);
+			navHook: (path) => {
+				this.navigate(path);
 			}
 		};
 	},
 
 	data() {
 		return {
-			url: null,
+			path: null,
 			component: null,
 			props: {},
 			pageInfo: null,
@@ -44,6 +45,12 @@ export default defineComponent({
 		};
 	},
 
+	computed: {
+		url(): string {
+			return url + this.path;
+		}
+	},
+
 	methods: {
 		changePage(page) {
 			if (page == null) return;
@@ -52,10 +59,10 @@ export default defineComponent({
 			}
 		},
 
-		navigate(url, record = true) {
-			if (record && this.url) this.history.push(this.url);
-			this.url = url;
-			const { component, props } = resolve(url);
+		navigate(path, record = true) {
+			if (record && this.path) this.history.push(this.path);
+			this.path = path;
+			const { component, props } = resolve(path);
 			this.component = component;
 			this.props = props;
 		},
@@ -65,7 +72,7 @@ export default defineComponent({
 		},
 
 		close() {
-			this.url = null;
+			this.path = null;
 			this.component = null;
 			this.props = {};
 		},
@@ -73,19 +80,19 @@ export default defineComponent({
 		onContextmenu(e) {
 			os.contextMenu([{
 				type: 'label',
-				text: this.url,
+				text: this.path,
 			}, {
 				icon: faExpandAlt,
 				text: this.$t('showInPage'),
 				action: () => {
-					this.$router.push(this.url);
+					this.$router.push(this.path);
 					this.close();
 				}
 			}, {
 				icon: faWindowMaximize,
 				text: this.$t('openInWindow'),
 				action: () => {
-					os.pageWindow(this.url);
+					os.pageWindow(this.path);
 					this.close();
 				}
 			}, null, {
-- 
cgit v1.2.3-freya

