main menu: handle titles that are images
This commit is contained in:
parent
7f410b6048
commit
ac059ba618
1 changed files with 11 additions and 6 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue