Apply history also on page load

This commit is contained in:
Thomas Gelf 2014-03-10 14:48:40 +00:00
parent e291974e55
commit e0be89a1dc
1 changed files with 11 additions and 4 deletions

View File

@ -49,6 +49,7 @@
) {
this.enabled = true;
this.icinga.logger.debug('History API enabled');
this.applyLocationBar();
$(window).on('popstate', { self: this }, this.onHistoryChange);
}
@ -98,9 +99,7 @@
var self = event.data.self,
icinga = self.icinga,
onload,
main,
parts;
onload;
icinga.logger.debug('Got a history change');
@ -117,6 +116,15 @@
icinga.logger.debug('History state', event.originalEvent.state);
}
self.applyLocationBar();
},
applyLocationBar: function () {
var icinga = this.icinga,
main,
parts;
// TODO: Still hardcoding col1/col2, shall be dynamic soon
main = document.location.pathname + document.location.search;
if ($('#col1').data('icingaUrl') !== main) {
@ -145,7 +153,6 @@
// TODO: Replace with dynamic columns
icinga.ui.layout1col();
}
},
/**