mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-14 07:52:15 +00:00
Fix chat @-mentions not opening in a modal (#13581)
* fix #13276 * Fix eslint no-useless-concat
This commit is contained in:
parent
14bdb5de67
commit
dc5b85097e
1 changed files with 7 additions and 3 deletions
|
|
@ -282,11 +282,15 @@ export default {
|
|||
mounted () {
|
||||
const links = this.$refs.markdownContainer.getElementsByTagName('a');
|
||||
for (let i = 0; i < links.length; i += 1) {
|
||||
const link = links[i];
|
||||
if (links[i].getAttribute('href').startsWith('/profile/')) {
|
||||
let link = links[i].pathname;
|
||||
|
||||
// Internet Explorer does not provide the leading slash character in the pathname
|
||||
link = link.charAt(0) === '/' ? link : `/${link}`;
|
||||
|
||||
if (link.startsWith('/profile/')) {
|
||||
links[i].onclick = ev => {
|
||||
ev.preventDefault();
|
||||
this.$router.push({ path: link.getAttribute('href') });
|
||||
this.$router.push({ path: link });
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue