Menu: when clicking on file item, but next to the file input, don't trigger a click event
This commit is contained in:
parent
b1019a7c5d
commit
f70946ff62
1 changed files with 13 additions and 6 deletions
|
@ -169,11 +169,15 @@ Ox.Menu = function(options, self) {
|
|||
});
|
||||
}
|
||||
} else {
|
||||
// if item.options.files && !files, the click happened outside
|
||||
// the title - as a workaround, we don't trigger a click event.
|
||||
if (!item.options('file') || files) {
|
||||
menu.triggerEvent('click', Ox.extend({
|
||||
id: item.options('id'),
|
||||
title: Ox.stripTags(item.options('title')[0])
|
||||
}, files ? {files: files} : {}));
|
||||
}
|
||||
}
|
||||
if (item.options('title').length == 2) {
|
||||
item.toggleTitle();
|
||||
}
|
||||
|
@ -242,7 +246,10 @@ Ox.Menu = function(options, self) {
|
|||
}
|
||||
|
||||
function mouseleave() {
|
||||
if (self.options.selected > -1 && !that.items[self.options.selected].options('items').length) {
|
||||
if (
|
||||
self.options.selected > -1
|
||||
&& !that.items[self.options.selected].options('items').length
|
||||
) {
|
||||
selectItem(-1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue