mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-04-08 17:15:08 +02:00
application-state.js: Only run once when the layout is rendered
This commit is contained in:
parent
30326dd1bb
commit
f932a4a44c
@ -1,6 +1,5 @@
|
|||||||
/*! Icinga Web 2 | (c) 2015 Icinga Development Team | GPLv2+ */
|
/*! Icinga Web 2 | (c) 2015 Icinga Development Team | GPLv2+ */
|
||||||
|
|
||||||
// @TODO(el): https://dev.icinga.com/issues/10646
|
|
||||||
(function(Icinga, $) {
|
(function(Icinga, $) {
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
@ -9,13 +8,18 @@
|
|||||||
|
|
||||||
var ApplicationState = function (icinga) {
|
var ApplicationState = function (icinga) {
|
||||||
Icinga.EventListener.call(this, icinga);
|
Icinga.EventListener.call(this, icinga);
|
||||||
this.on('rendered', this.onRendered, this);
|
this.on('rendered', '#layout', this.onRendered, this);
|
||||||
this.icinga = icinga;
|
this.icinga = icinga;
|
||||||
};
|
};
|
||||||
|
|
||||||
ApplicationState.prototype = new Icinga.EventListener();
|
ApplicationState.prototype = new Icinga.EventListener();
|
||||||
|
|
||||||
ApplicationState.prototype.onRendered = function(e) {
|
ApplicationState.prototype.onRendered = function(e) {
|
||||||
|
if (e.currentTarget !== e.target) {
|
||||||
|
// Nested containers are ignored
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (! $('#application-state').length
|
if (! $('#application-state').length
|
||||||
&& ! $('#login').length
|
&& ! $('#login').length
|
||||||
&& ! $('#guest-error').length
|
&& ! $('#guest-error').length
|
||||||
|
Loading…
x
Reference in New Issue
Block a user