Add event.stopPropagation() to extraNetworksShowMetadata()
Prevent bubbling the same way "replace preview" does
This commit is contained in:
parent
64fc936738
commit
8e3ced73a8
|
@ -132,10 +132,12 @@ function popup(contents){
|
|||
globalPopup.style.display = "flex";
|
||||
}
|
||||
|
||||
function extraNetworksShowMetadata(text){
|
||||
function extraNetworksShowMetadata(event, text){
|
||||
elem = document.createElement('pre')
|
||||
elem.classList.add('popup-metadata');
|
||||
elem.textContent = text;
|
||||
|
||||
popup(elem);
|
||||
|
||||
event.stopPropagation()
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ class ExtraNetworksPage:
|
|||
metadata_button = ""
|
||||
metadata = item.get("metadata")
|
||||
if metadata:
|
||||
metadata_onclick = '"' + html.escape(f"""extraNetworksShowMetadata({json.dumps(metadata)}); event.stopPropagation(); return false;""") + '"'
|
||||
metadata_onclick = '"' + html.escape(f"""return extraNetworksShowMetadata(event, {json.dumps(metadata)})""") + '"'
|
||||
metadata_button = f"<div class='metadata-button' title='Show metadata' onclick={metadata_onclick}></div>"
|
||||
|
||||
args = {
|
||||
|
|
Loading…
Reference in New Issue