add option to show the avatar instead of the logo
This commit is contained in:
+7
-2
@@ -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("', '')
|
||||
|
||||
Reference in New Issue
Block a user