aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings/src/main-nextcloud-pdf.js
blob: 55d689c0f4a0eaf62a389c7d74bbfd9b0efbf619 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/**
 * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */

import { loadState } from '@nextcloud/initial-state'

const hasPdf = loadState('settings', 'has-reasons-use-nextcloud-pdf') === true

window.addEventListener('DOMContentLoaded', function() {
	const link = document.getElementById('open-reasons-use-nextcloud-pdf')
	if (link && hasPdf) {
		link.addEventListener('click', function(event) {
			event.preventDefault()
			OCA.Viewer.open({
				path: '/Reasons to use Nextcloud.pdf',
			})
		})
	}
})