JS: Fix doc of navigation::onRendered()

refs #5543
This commit is contained in:
Eric Lippmann 2015-11-09 16:44:19 +01:00
parent bb432fcc68
commit 70d7f7f669

View File

@ -42,21 +42,21 @@
Navigation.prototype = new Icinga.EventListener(); Navigation.prototype = new Icinga.EventListener();
/** /**
* Apply the menu selection and hovering according to the current state * Activate menu items if their class is set to active or if the current URL matches their link
* *
* @param evt {Object} The event context * @param {Object} e Event
*/ */
Navigation.prototype.onRendered = function(evt) { Navigation.prototype.onRendered = function(e) {
var _this = evt.data.self; var _this = e.data.self;
this.element = evt.target; this.element = e.target;
if (! _this.active) { if (! _this.active) {
// There is no stored menu item, therefore it is assumed that this is the first rendering // There is no stored menu item, therefore it is assumed that this is the first rendering
// of the navigation after the page has been opened. // of the navigation after the page has been opened.
// initialise the menu selected by the backend as active. // initialise the menu selected by the backend as active.
var $menus = $('#menu li.active', evt.target); var $menus = $('#menu li.active', e.target);
if ($menus.size()) { if ($menus.size()) {
$menus.each(function () { $menus.each(function () {
_this.setActive($(this)); _this.setActive($(this));