summaryrefslogtreecommitdiffstats
path: root/core/src/components/MainMenu.js
blob: 0799a6eabc4e33c09c4666be0bac53431bcedb86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
 * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */

import { translate as t, translatePlural as n } from '@nextcloud/l10n'
import Vue from 'vue'

import AppMenu from './AppMenu.vue'

export const setUp = () => {

	Vue.mixin({
		methods: {
			t,
			n,
		},
	})

	const container = document.getElementById('header-left__appmenu')
	if (!container) {
		// no container, possibly we're on a public page
		return
	}
	const AppMenuApp = Vue.extend(AppMenu)
	const appMenu = new AppMenuApp({}).$mount(container)

	Object.assign(OC, {
		setNavigationCounter(id, counter) {
			appMenu.setNavigationCounter(id, counter)
		},
	})

}