Skip to content

Commit

Permalink
fix(publicpage): selector for popupmenu
Browse files Browse the repository at this point in the history
As the action is now slotted into the custom header, the .header-right class is no longer
available. Styling the slotted button from inside the Header did not work for me (::slotted), therefore changing the selector is necessary.

Signed-off-by: Kai Henseler <[email protected]>
  • Loading branch information
bromiesTM committed Jan 13, 2025
1 parent e006416 commit d543dc0
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions core/js/public/publicpage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

window.addEventListener('DOMContentLoaded', function () {

$('#body-public').find('#ionos-global-nav .menutoggle').click(function() {
$(this).next('.popovermenu').toggleClass('open');
});

$('#save-external-share').click(function () {
$('#external-share-menu-item').toggleClass('hidden')
$('#remote_address').focus();
});

$(document).mouseup(function(e) {
var toggle = $('#body-public').find('#ionos-global-nav .menutoggle');
var container = toggle.next('.popovermenu');

// if the target of the click isn't the menu toggle, nor a descendant of the
// menu toggle, nor the container nor a descendant of the container
if (!toggle.is(e.target) && toggle.has(e.target).length === 0 &&
!container.is(e.target) && container.has(e.target).length === 0) {
container.removeClass('open');
}
});

});

0 comments on commit d543dc0

Please sign in to comment.