User:SayuriDarling/global.js

require(['wikia.window', 'mw'], function(context, mw) {   var globalNav = document.getElementById('globalNavigation');    Array.prototype.slice.call(globalNav.getElementsByClassName('wds-global-navigation__dropdown-toggle')).forEach(function(elem){ elem.addEventListener('mouseenter', elem.click); elem.parentNode.addEventListener('mouseleave', elem.click.bind(elem)); });   globalNav.querySelector('.wds-avatar').addEventListener('click', function  { context.location = (new mw.Title(mw.user.name, 2)).getUrl; }); });