blob: 4a1399f3f96e14073d051721de0d3a6bbcbf3508 (
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
|
/**
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { loadState } from '@nextcloud/initial-state'
/**
* Set the page heading
*
* @param {string} heading page title from the history api
* @since 27.0.0
*/
export function setPageHeading(heading) {
const headingEl = document.getElementById('page-heading-level-1')
if (headingEl) {
headingEl.textContent = heading
}
}
export default {
/**
* @return {boolean} Whether the user opted-out of shortcuts so that they should not be registered
*/
disableKeyboardShortcuts() {
return loadState('theming', 'shortcutsDisabled', false)
},
setPageHeading,
}
|