From 5ca0d63014a5772ac8c805a29a7d1032c324dba5 Mon Sep 17 00:00:00 2001 From: jin Date: Fri, 5 Jan 2024 17:18:55 +0300 Subject: [PATCH] $mol_text: relative base support --- text/text/text.view.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/text/text/text.view.ts b/text/text/text.view.ts index 8ac035bd614..6d9a713cd5c 100644 --- a/text/text/text.view.ts +++ b/text/text/text.view.ts @@ -151,6 +151,11 @@ namespace $.$$ { return $mol_dom_context.document.location.href } + @ $mol_mem + uri_base_abs() { + return new URL( this.uri_base() , $mol_dom_context.document.location.href ) + } + @ $mol_mem_key uri_resolve( uri: string ) { @@ -172,7 +177,7 @@ namespace $.$$ { try { - const url = new URL( uri , this.uri_base() ) + const url = new URL( uri , this.uri_base_abs() ) return url.toString() } catch( error ) {