[responsive] Support for history and popState
@@ -584,6 +584,7 @@ ${ assist.assistPanel() }
$('#embeddable_' + newVal).insertBefore($('.embeddable:first')).show();
});
+ self.loadAppState = function () {
if (window.location.getParameter('app') !== '' && self.EMBEDDABLE_PAGE_URLS[window.location.getParameter('app')]) {
var app = window.location.getParameter('app');
switch (app) {
@@ -614,6 +615,13 @@ ${ assist.assistPanel() }
else {
self.currentApp('editor');
}
+ }
+
+ self.loadAppState();
+
+ window.onpopstate = function (event) {
+ self.loadAppState();
+ };
huePubSub.subscribe('switch.app', function (name) {
self.currentApp(name);
