diff --git a/source/Ox.UI/js/Core/Ox.Focus.js b/source/Ox.UI/js/Core/Ox.Focus.js index 2c021a4c..65910ec8 100644 --- a/source/Ox.UI/js/Core/Ox.Focus.js +++ b/source/Ox.UI/js/Core/Ox.Focus.js @@ -26,7 +26,8 @@ Ox.Focus = (function() { : stack.splice(stack.length - 2, 0, stack.pop()); //$elements[id].removeClass('OxFocus'); $('.OxFocus').removeClass('OxFocus'); // fixme: the above is better, and should work - stack.length && Ox.UI.elements[stack[stack.length - 1]].addClass('OxFocus'); + stack.length && Ox.UI.elements[stack[stack.length - 1]] + .addClass('OxFocus').triggerEvent('focus'); Ox.Log('Core', 'blur', id, stack); } }, @@ -41,7 +42,8 @@ Ox.Focus = (function() { stack.push(id); $('.OxFocus').removeClass('OxFocus'); // fixme: see above Ox.Log('Core', 'focus', id, stack); - Ox.UI.elements[id].addClass('OxFocus'); + Ox.UI.elements[id] + .addClass('OxFocus').triggerEvent('focus'); } }, /*@ diff --git a/source/Ox.UI/js/Menu/Ox.MainMenu.js b/source/Ox.UI/js/Menu/Ox.MainMenu.js index 4abed19f..c8ab22ce 100644 --- a/source/Ox.UI/js/Menu/Ox.MainMenu.js +++ b/source/Ox.UI/js/Menu/Ox.MainMenu.js @@ -140,7 +140,8 @@ Ox.MainMenu = function(options, self) { checkItem checkItem @*/ that.checkItem = function(id) { - that.getItem(id).options({checked: true}); + var item = that.getItem(id); + item && item.options({checked: true}); return that; }; @@ -148,7 +149,8 @@ Ox.MainMenu = function(options, self) { disableItem disableItem @*/ that.disableItem = function(id) { - that.getItem(id).options({disabled: true}); + var item = that.getItem(id); + item && item.options({disabled: true}); return that; }; @@ -156,7 +158,8 @@ Ox.MainMenu = function(options, self) { enableItem enableItem @*/ that.enableItem = function(id) { - that.getItem(id).options({disabled: false}); + var item = that.getItem(id); + item && item.options({disabled: false}); return that; }; @@ -229,7 +232,8 @@ Ox.MainMenu = function(options, self) { }; that.setItemTitle = function(id, title) { - that.getItem(id).options({title: title}); + var item = that.getItem(id); + item && item.options({title: title}); return that; }; @@ -237,7 +241,8 @@ Ox.MainMenu = function(options, self) { uncheckItem uncheckItem @*/ that.uncheckItem = function(id) { - that.getItem(id).options({checked: false}); + var item = that.getItem(id); + item && item.options({checked: false}); return that; };