add option to show the avatar instead of the logo

This commit is contained in:
Simon Vieille
2020-09-18 11:09:01 +02:00
parent 85c25f0fc7
commit e5dd893774
5 changed files with 39 additions and 2 deletions
+7 -2
View File
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<div class="side-menu-header">
<button class="side-menu-opener"></button>
<div v-if="logo" class="side-menu-logo">
<div v-if="logo" v-bind:class="{'side-menu-logo': true, 'avatardiv': isAvatar}">
<img v-bind:src="logo">
</div>
</div>
@@ -46,6 +46,7 @@ export default {
logo: null,
forceLightIcon: false,
targetBlank: false,
isAvatar: false,
}
},
methods: {
@@ -104,8 +105,12 @@ export default {
},
retrieveLogo() {
const ncLogo = document.querySelector('#nextcloud .logo')
const avatar = document.querySelector('#side-menu-container').getAttribute('data-avatar');
if (ncLogo) {
if (avatar) {
this.logo = avatar
this.isAvatar = true
} else if (ncLogo) {
const url = window.getComputedStyle(ncLogo, null)
.getPropertyValue('background-image')
.replace('url("', '')