diff --git a/source/Ox.UI/js/Form/Select.js b/source/Ox.UI/js/Form/Select.js index 09edc2c5..830bd3bd 100644 --- a/source/Ox.UI/js/Form/Select.js +++ b/source/Ox.UI/js/Form/Select.js @@ -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(); } diff --git a/source/Ox.UI/js/Menu/MenuButton.js b/source/Ox.UI/js/Menu/MenuButton.js index 69067f5d..178b4706 100644 --- a/source/Ox.UI/js/Menu/MenuButton.js +++ b/source/Ox.UI/js/Menu/MenuButton.js @@ -60,7 +60,9 @@ Ox.MenuButton = function(options, self) { width: self.options.width - 2 + 'px' }) .bindEvent({ - anyclick: showMenu + anyclick: function(e) { + showMenu($(e.target).is('.OxButton') ? 'button' : null); + }, }); if (self.options.type == 'text') { @@ -112,10 +114,10 @@ Ox.MenuButton = function(options, self) { that.triggerEvent('hide'); } - 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(); that.triggerEvent('show');