js: Fix error on app startup
jQuery seems to re-cycle event object references oO
This commit is contained in:
parent
97f8767970
commit
9ef4c71cec
|
@ -14,11 +14,13 @@
|
|||
Autofocus.prototype = new Icinga.EventListener();
|
||||
|
||||
Autofocus.prototype.onRendered = function(e) {
|
||||
setTimeout(function() {
|
||||
if (document.activeElement === e.target
|
||||
const _this = e.data.self;
|
||||
const target = e.target;
|
||||
setTimeout(() => {
|
||||
if (document.activeElement === target
|
||||
|| document.activeElement === document.body
|
||||
) {
|
||||
e.data.self.icinga.ui.focusElement($(e.target).find('.autofocus'));
|
||||
_this.icinga.ui.focusElement($(target).find('.autofocus'));
|
||||
}
|
||||
}, 0);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue