Merge branch '172-favicon-should-match-room-logo'
This commit is contained in:
commit
b53fa91e83
3 changed files with 24 additions and 4 deletions
|
|
@ -4,7 +4,7 @@
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
<link rel="icon" id="favicon" href="<%= BASE_URL %>favicon.ico">
|
||||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
||||||
17
src/App.vue
17
src/App.vue
|
|
@ -127,6 +127,16 @@ export default {
|
||||||
}
|
}
|
||||||
return title;
|
return title;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
favicon() {
|
||||||
|
var favicon = undefined;
|
||||||
|
if (this.$route.meta.includeFavicon) {
|
||||||
|
if (this.$matrix.currentRoom) {
|
||||||
|
favicon = this.$matrix.currentRoom.avatar || 'favicon.ico';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return favicon;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
"$i18n.locale": {
|
"$i18n.locale": {
|
||||||
|
|
@ -149,6 +159,13 @@ export default {
|
||||||
},
|
},
|
||||||
immediate: true,
|
immediate: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
favicon: {
|
||||||
|
handler(favicon) {
|
||||||
|
document.getElementById("favicon").setAttribute('href', favicon);
|
||||||
|
},
|
||||||
|
immediate: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,8 @@ const routes = [
|
||||||
name: 'Chat',
|
name: 'Chat',
|
||||||
component: Chat,
|
component: Chat,
|
||||||
meta: {
|
meta: {
|
||||||
includeRoom: true
|
includeRoom: true,
|
||||||
|
includeFavicon: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -32,7 +33,8 @@ const routes = [
|
||||||
props: true,
|
props: true,
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Info',
|
title: 'Info',
|
||||||
includeRoom: true
|
includeRoom: true,
|
||||||
|
includeFavicon: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -40,7 +42,8 @@ const routes = [
|
||||||
name: 'Profile',
|
name: 'Profile',
|
||||||
component: Profile,
|
component: Profile,
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Profile'
|
title: 'Profile',
|
||||||
|
includeFavicon: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue