mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-04-08 17:15:08 +02:00
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 = new Icinga.EventListener();
|
||||||
|
|
||||||
Autofocus.prototype.onRendered = function(e) {
|
Autofocus.prototype.onRendered = function(e) {
|
||||||
setTimeout(function() {
|
const _this = e.data.self;
|
||||||
if (document.activeElement === e.target
|
const target = e.target;
|
||||||
|
setTimeout(() => {
|
||||||
|
if (document.activeElement === target
|
||||||
|| document.activeElement === document.body
|
|| document.activeElement === document.body
|
||||||
) {
|
) {
|
||||||
e.data.self.icinga.ui.focusElement($(e.target).find('.autofocus'));
|
_this.icinga.ui.focusElement($(target).find('.autofocus'));
|
||||||
}
|
}
|
||||||
}, 0);
|
}, 0);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user