Make remote edit work when /edit is loaded
Change detection of the edit request to use the URL as the class will not be set on the body now, and force the router to think we actually loaded the normal view.
This commit is contained in:
parent
a51b4c869e
commit
6670de16a1
2 changed files with 10 additions and 4 deletions
|
@ -201,10 +201,6 @@ $(document).ready(function () {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (OSM.preferred_editor == "remote" && $('body').hasClass("site-edit")) {
|
|
||||||
remoteEditHandler(map.getBounds());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (OSM.params().edit_help) {
|
if (OSM.params().edit_help) {
|
||||||
$('#editanchor')
|
$('#editanchor')
|
||||||
.removeAttr('title')
|
.removeAttr('title')
|
||||||
|
@ -284,6 +280,11 @@ $(document).ready(function () {
|
||||||
"/changeset/:id": OSM.Browse(map, 'changeset')
|
"/changeset/:id": OSM.Browse(map, 'changeset')
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (OSM.preferred_editor == "remote" && document.location.pathname == "/edit") {
|
||||||
|
remoteEditHandler(map.getBounds());
|
||||||
|
OSM.router.setCurrentPath("/");
|
||||||
|
}
|
||||||
|
|
||||||
OSM.router.load();
|
OSM.router.load();
|
||||||
|
|
||||||
$(document).on("click", "a", function(e) {
|
$(document).on("click", "a", function(e) {
|
||||||
|
|
|
@ -167,6 +167,11 @@ OSM.Router = function(map, rts) {
|
||||||
router.stateChange(loadState || {});
|
router.stateChange(loadState || {});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
router.setCurrentPath = function (path) {
|
||||||
|
currentPath = path;
|
||||||
|
currentRoute = routes.recognize(currentPath);
|
||||||
|
};
|
||||||
|
|
||||||
map.on('moveend baselayerchange overlaylayerchange', router.updateHash);
|
map.on('moveend baselayerchange overlaylayerchange', router.updateHash);
|
||||||
$(window).on('hashchange', router.hashUpdated);
|
$(window).on('hashchange', router.hashUpdated);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue