diff --git a/source/Ox.UI/js/Menu/MainMenu.js b/source/Ox.UI/js/Menu/MainMenu.js index aa1fa1d3..3f58d22c 100644 --- a/source/Ox.UI/js/Menu/MainMenu.js +++ b/source/Ox.UI/js/Menu/MainMenu.js @@ -70,9 +70,9 @@ Ox.MainMenu = function(options, self) { } function click(event) { - var $target = $(event.target), - position = typeof $target.data('position') != 'undefined' - ? $target.data('position') : -1; + var $element = getElement(event), + position = typeof $element.data('position') != 'undefined' + ? $element.data('position') : -1; clickTitle(position); } @@ -91,11 +91,16 @@ Ox.MainMenu = function(options, self) { } } + function getElement(event) { + var $element = $(event.target); + return $element.is('img') ? $element.parent() : $element; + } + function mousemove(event) { - var $target = $(event.target), + var $element = getElement(event), focused, - position = typeof $target.data('position') != 'undefined' - ? $target.data('position') : -1; + position = typeof $element.data('position') != 'undefined' + ? $element.data('position') : -1; if (self.focused && position != self.selected) { if (position > -1) { clickTitle(position);