mirror of
https://github.com/gradio-app/gradio.git
synced 2025-02-05 11:10:03 +08:00
only affect links within the document (#1282)
This commit is contained in:
parent
8b1a50775a
commit
e49cf6f72d
@ -56,6 +56,7 @@
|
||||
export let static_src: string;
|
||||
export let title: string = "Gradio";
|
||||
export let analytics_enabled: boolean = false;
|
||||
export let target: HTMLElement;
|
||||
|
||||
let rootNode: Component = { id: layout.id, type: "column", props: {} };
|
||||
components.push(rootNode);
|
||||
@ -181,11 +182,11 @@
|
||||
async function handle_mount() {
|
||||
await tick();
|
||||
|
||||
var a = document.getElementsByTagName("a");
|
||||
var a = target.getElementsByTagName("a");
|
||||
|
||||
for (var i = 0; i < a.length; i++) {
|
||||
const target = a[i].getAttribute("target");
|
||||
if (target !== "_blank") a[i].setAttribute("target", "_blank");
|
||||
const _target = a[i].getAttribute("target");
|
||||
if (_target !== "_blank") a[i].setAttribute("target", "_blank");
|
||||
}
|
||||
|
||||
dependencies.forEach(
|
||||
|
@ -98,7 +98,7 @@ window.launchGradio = (config: Config, element_query: string) => {
|
||||
|
||||
new Blocks({
|
||||
target: target,
|
||||
props: config
|
||||
props: { ...config, target }
|
||||
});
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user