add comment url param to prefill changeset comment (closes #2311)

for integration with HOT Task Manager or other OSM tools
This commit is contained in:
Bryan Housel
2014-08-11 19:51:52 -04:00
parent 9a2f30d62a
commit 21da76cf80

View File

@@ -18,7 +18,7 @@ iD.behavior.Hash = function(context) {
center = map.center(),
zoom = map.zoom(),
precision = Math.max(0, Math.ceil(Math.log(zoom) / Math.LN2)),
q = iD.util.stringQs(location.hash.substring(1)),
q = _.omit(iD.util.stringQs(location.hash.substring(1)), 'comment'),
newParams = {};
if (mode && mode.id === 'browse') {
@@ -66,6 +66,7 @@ iD.behavior.Hash = function(context) {
if (location.hash) {
var q = iD.util.stringQs(location.hash.substring(1));
if (q.id) context.loadEntity(q.id.split(',')[0], !q.map);
if (q.comment) context.storage('comment', q.comment);
hashchange();
if (q.map) hash.hadHash = true;
}