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) {
|
function click(event) {
|
||||||
var $target = $(event.target),
|
var $element = getElement(event),
|
||||||
position = typeof $target.data('position') != 'undefined'
|
position = typeof $element.data('position') != 'undefined'
|
||||||
? $target.data('position') : -1;
|
? $element.data('position') : -1;
|
||||||
clickTitle(position);
|
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) {
|
function mousemove(event) {
|
||||||
var $target = $(event.target),
|
var $element = getElement(event),
|
||||||
focused,
|
focused,
|
||||||
position = typeof $target.data('position') != 'undefined'
|
position = typeof $element.data('position') != 'undefined'
|
||||||
? $target.data('position') : -1;
|
? $element.data('position') : -1;
|
||||||
if (self.focused && position != self.selected) {
|
if (self.focused && position != self.selected) {
|
||||||
if (position > -1) {
|
if (position > -1) {
|
||||||
clickTitle(position);
|
clickTitle(position);
|
||||||
|
|
Loading…
Reference in a new issue