From 66a130e35f48b32c26bf52999804931ed0a82c3d Mon Sep 17 00:00:00 2001 From: j Date: Sat, 29 Jul 2017 22:06:27 +0200 Subject: [PATCH] element can also be removed during gainfocus --- source/UI/js/Core/Focus.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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 +}());