Fix share button

This commit is contained in:
Pieter Vander Vennet 2020-11-23 12:54:10 +01:00
parent 02ce4e5d7e
commit 4d2e8b6f24
4 changed files with 14 additions and 17 deletions

View file

@ -197,19 +197,23 @@ export default class SpecialVisualizations {
}
],
constr: (tagSource: UIEventSource<any>, args) => {
if (window.navigator.share) {
if (window.navigator.share || true) {
const title = State.state.layoutToUse.data.title.txt;
let name = tagSource.data.name;
if(name){
if (name) {
name = `${name} (${title})`
}else{
} else {
name = title;
}
return new ShareButton(Svg.share_svg(), {
title: name,
url: args[0] ?? window.location.href,
text: State.state.layoutToUse.data.shortDescription.txt
})
let url = args[0] ?? ""
if (url === "") {
url = window.location.href
}
return new ShareButton(Svg.share_svg(), {
title: name,
url: url,
text: State.state.layoutToUse.data.shortDescription.txt
})
} else {
return new FixedUiElement("")
}