diff options
Diffstat (limited to 'core/src/OC/menu.js')
-rw-r--r-- | core/src/OC/menu.js | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/core/src/OC/menu.js b/core/src/OC/menu.js index 82cde9e862d..4b4eb658592 100644 --- a/core/src/OC/menu.js +++ b/core/src/OC/menu.js @@ -1,28 +1,13 @@ /** - * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> - * - * @author 2019 Christoph Wurst <christoph@winzerhof-wurst.at> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ import _ from 'underscore' +/** @typedef {import('jquery')} jQuery */ import $ from 'jquery' -import { menuSpeed } from './constants' +import { menuSpeed } from './constants.js' export let currentMenu = null export let currentMenuToggle = null @@ -32,9 +17,9 @@ export let currentMenuToggle = null * * @param {jQuery} $toggle the toggle element * @param {jQuery} $menuEl the menu container element - * @param {function|undefined} toggle callback invoked everytime the menu is opened + * @param {Function | undefined} toggle callback invoked everytime the menu is opened * @param {boolean} headerMenu is this a top right header menu? - * @returns {undefined} + * @return {void} */ export const registerMenu = function($toggle, $menuEl, toggle, headerMenu) { $menuEl.addClass('menu') @@ -107,6 +92,9 @@ export const hideMenus = function(complete) { // Set menu to closed $('.menutoggle').attr('aria-expanded', false) + if (currentMenuToggle) { + currentMenuToggle.attr('aria-expanded', false) + } $('.openedMenu').removeClass('openedMenu') currentMenu = null @@ -116,8 +104,8 @@ export const hideMenus = function(complete) { /** * Shows a given element as menu * - * @param {Object} [$toggle=null] menu toggle - * @param {Object} $menuEl menu element + * @param {object} [$toggle] menu toggle + * @param {object} $menuEl menu element * @param {Function} complete callback when the showing animation is done */ export const showMenu = ($toggle, $menuEl, complete) => { |