Skip to content

Commit

Permalink
Reindent
Browse files Browse the repository at this point in the history
  • Loading branch information
Nachtalb committed Dec 19, 2019
1 parent 7a38dfc commit d2a539c
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions ftw/subsite/browser/resources/dropdown.js
@@ -1,36 +1,36 @@
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module. (Plone 5 with requirejs)
define(['jquery'], factory);
} else {
// Browser globals (Plone 4 without requirejs)
factory(root.jQuery);
}
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module. (Plone 5 with requirejs)
define(['jquery'], factory);
} else {
// Browser globals (Plone 4 without requirejs)
factory(root.jQuery);
}
}(typeof self !== 'undefined' ? self : this, function ($, anotherThing) {
function hide() {
$('#portal-languageselector').removeClass('activated').addClass('deactivated');
$('#portal-languageselector').removeClass('activated').addClass('deactivated');
}

function toggle() {
$('#portal-languageselector')
.toggleClass('deactivated')
.toggleClass('activated');
return false;
$('#portal-languageselector')
.toggleClass('deactivated')
.toggleClass('activated');
return false;
}

function hideOnOutsideClick(event) {
if ($(event.target).parents('#portal-languageselector').length === 0) {
hide();
}
if ($(event.target).parents('#portal-languageselector').length === 0) {
hide();
}
}

function initializeMenu() {
hide();
hide();

$(document).on('mousedown', hideOnOutsideClick);
$(document).on('mousedown', hideOnOutsideClick);

$('#portal-languageselector .actionMenuHeader a').on('click', toggle)
$('#portal-languageselector .actionMenuContent').on('click', hide);
$('#portal-languageselector .actionMenuHeader a').on('click', toggle)
$('#portal-languageselector .actionMenuContent').on('click', hide);
}

$(initializeMenu)
Expand Down

0 comments on commit d2a539c

Please sign in to comment.