1
0
Fork 0
forked from 0x2620/oxjs

fix for MenuButton and Select double button toggle

This commit is contained in:
rolux 2012-12-29 02:18:50 +01:00
commit a9c026f6db
2 changed files with 10 additions and 6 deletions

View file

@ -90,7 +90,9 @@ Ox.Select = function(options, self) {
width: self.options.width - 2 + 'px'
})
.bindEvent({
anyclick: showMenu,
anyclick: function(e) {
showMenu($(e.target).is('.OxButton') ? 'button' : null);
},
key_escape: loseFocus,
key_down: showMenu
});
@ -214,10 +216,10 @@ Ox.Select = function(options, self) {
}
function showMenu() {
function showMenu(from) {
that.gainFocus();
that.addClass('OxSelected');
self.$button.options({value: true});
from != 'button' && self.$button.options({value: true});
self.options.tooltip && that.$tooltip.hide();
self.$menu.showMenu();
}