// Gets the sub-menu of the active menu item, if there is one.
var $subMenu = $this.find('.main-menu__sub-menu').first();

if ($subMenu.length) {
// Do something...
}
},
mouseleave: function(e) {
// Perform the same checks, and get the same variables as above...
},
click: function(e) {
// Again, perform the same checks and grab the same variables as above...
}

I obviously don't want to repeat my logic, but I require getting the

li

element that's firing the event, which will be the same for all events within the event map... Hopefully that makes more sense?