fix(client): fix popout url (#8494)

This commit is contained in:
futchitwo 2022-05-29 19:21:36 +09:00 committed by GitHub
parent 804fa33535
commit d2784030ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -126,7 +126,7 @@ let changed = $ref(false);
useLeaveGuard($$(changed));
function showPreview() {
os.pageWindow('preview');
os.pageWindow('/preview');
}
function setBgColor(color: typeof bgColors[number]) {

View file

@ -1,8 +1,9 @@
import * as config from '@/config';
import { appendQuery } from './url';
export function popout(path: string, w?: HTMLElement) {
let url = path.startsWith('http://') || path.startsWith('https://') ? path : config.url + "/" + path;
url += '?zen';
let url = path.startsWith('http://') || path.startsWith('https://') ? path : config.url + path;
url = appendQuery(url, 'zen');
if (w) {
const position = w.getBoundingClientRect();
const width = parseInt(getComputedStyle(w, '').width, 10);