Sha256: b1b4375c09132532c2e5975dab9649a3de61101308ec9385d2e9b62bcebc2dba
Contents?: true
Size: 565 Bytes
Versions: 25
Compression:
Stored size: 565 Bytes
Contents
export default function page() { return { init() {}, scrollToTop() { this.$refs.scroller.scrollTop = 0; }, checkForNavigation(event) { const link = event.target.closest("a[href]"); if ( link && !isExternalLink(link.href) && link.getAttribute("target") !== "_blank" ) { event.preventDefault(); this.setLocation(link.href); } }, }; } function isExternalLink(url) { const tmp = document.createElement("a"); tmp.href = url; return tmp.host !== window.location.host; }
Version data entries
25 entries across 25 versions & 1 rubygems