@ -48,7 +48,10 @@
{ { monitor . element . name } }
< / a >
< p v -else class = "item-name" > { { monitor . element . name } } < / p >
< span title = "Toggle Clickable Link" >
< span
v - if = "showLink(monitor, true)"
title = "Toggle Clickable Link"
>
< font -awesome -icon
v - if = "editMode"
: class = "{'link-active': monitor.element.sendUrl, 'btn-link': true}"
@ -145,11 +148,17 @@ export default {
* Attempts to guess if a link should be shown based upon if
* sendUrl is set and if the URL is default or not .
* @ param { Object } monitor Monitor to check
* @ param { boolean } [ ignoreSendUrl = false ] Should the presence of the sendUrl
* property be ignored . This will only work in edit mode .
* @ returns { boolean }
* /
showLink ( monitor ) {
return monitor . element . sendUrl && monitor . element . url && monitor . element . url !== "https://" ;
showLink ( monitor , ignoreSendUrl = false ) {
/ / W e m u s t c h e c k i f t h e r e a r e a n y e l e m e n t s i n m o n i t o r L i s t t o
/ / p r e v e n t u n d e f i n e d e r r o r s i f i t h a s n ' t b e e n l o a d e d y e t
if ( this . $parent . editMode && ignoreSendUrl && Object . keys ( this . $root . monitorList ) . length ) {
return this . $root . monitorList [ monitor . element . id ] . type === "http" || this . $root . monitorList [ monitor . element . id ] . type === "keyword" ;
}
return monitor . element . sendUrl && monitor . element . url && monitor . element . url !== "https://" && ! this . editMode ;
} ,
}
} ;