diff --git a/source/UI/js/Core/Focus.js b/source/UI/js/Core/Focus.js index 88d1d28c..6753c640 100644 --- a/source/UI/js/Core/Focus.js +++ b/source/UI/js/Core/Focus.js @@ -49,11 +49,15 @@ Ox.Focus = (function() { .triggerEvent('losefocus'); } catch(e) { that.cleanup(); - } + } + } + try { + $element + .addClass('OxFocus') + .triggerEvent('gainfocus'); + } catch(e) { + that.cleanup(); } - $element - .addClass('OxFocus') - .triggerEvent('gainfocus'); } }, hasFocus: function($element) { @@ -97,4 +101,4 @@ Ox.Focus = (function() { return that; -}()); \ No newline at end of file +}());