JS: Use _this when saving a reference to this in Navigation::onRendered()

There a tons of places where we use self instead of _this. self is a global variable in modern browsers.

refs #5543
This commit is contained in:
Eric Lippmann 2015-11-09 15:55:23 +01:00
parent 802cba3fb8
commit bb432fcc68
1 changed files with 7 additions and 5 deletions

View File

@ -47,10 +47,11 @@
* @param evt {Object} The event context
*/
Navigation.prototype.onRendered = function(evt) {
var self = evt.data.self;
var _this = evt.data.self;
this.element = evt.target;
if (! self.active) {
if (! _this.active) {
// 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.
@ -58,14 +59,15 @@
var $menus = $('#menu li.active', evt.target);
if ($menus.size()) {
$menus.each(function () {
self.setActive($(this));
_this.setActive($(this));
});
} else {
// if no item is marked as active, try to select the menu from the current URL
self.setActiveByUrl($('#col1').data('icingaUrl'));
_this.setActiveByUrl($('#col1').data('icingaUrl'));
}
}
self.refresh();
_this.refresh();
};
/**