From e8294f1c8f17ca0c7038de36a6e094334ba76137 Mon Sep 17 00:00:00 2001 From: Candid Dauth Date: Thu, 20 Oct 2016 14:48:40 +0300 Subject: [PATCH] More compatibility to old FacilMap permalinks --- frontend/app/map/hash/hash.js | 2 ++ frontend/index/index.js | 3 +++ 2 files changed, 5 insertions(+) diff --git a/frontend/app/map/hash/hash.js b/frontend/app/map/hash/hash.js index f41abca6..b6c7fdcd 100644 --- a/frontend/app/map/hash/hash.js +++ b/frontend/app/map/hash/hash.js @@ -148,6 +148,8 @@ if(typeof obj.q == "string") ret.push(obj.q); + else if(typeof obj.s == "string") + ret.push(obj.s); else if(typeof obj.q == "object") { Object.keys(obj.q).sort(function(a, b){return a-b}).forEach(function(i) { ret.push(obj.q[i]); diff --git a/frontend/index/index.js b/frontend/index/index.js index 42da015c..36977a80 100644 --- a/frontend/index/index.js +++ b/frontend/index/index.js @@ -3,6 +3,9 @@ fm.app.controller("PadCtrl", function($scope, fmMap, $timeout) { $scope.padId = decodeURIComponent(location.pathname.match(/[^\/]*$/)[0]); + if(location.search && (!location.hash || location.hash == "#")) + history.replaceState(null, "", fm.URL_PREFIX + ($scope.padId || "") + "#" + location.search.replace(/^\?/, "")); + $timeout(function() { var map = fmMap.getMap("map");