From 4e305ea773b90d96d368eb235cc06d2a930298e8 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Thu, 25 Apr 2013 11:16:56 -0400 Subject: [PATCH] don't permalink negative IDs (fixes #1374) --- js/id/modes/select.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/js/id/modes/select.js b/js/id/modes/select.js index a4dea42f2..4ab4adcf2 100644 --- a/js/id/modes/select.js +++ b/js/id/modes/select.js @@ -91,10 +91,16 @@ iD.modes.Select = function(context, selection) { }); }); - var q = iD.util.stringQs(location.hash.substring(1)); - location.replace('#' + iD.util.qsString(_.assign(q, { - id: selection.join(',') - }), true)); + var notNew = selection.filter(function(id) { + return !context.entity(id).isNew(); + }); + + if (notNew.length) { + var q = iD.util.stringQs(location.hash.substring(1)); + location.replace('#' + iD.util.qsString(_.assign(q, { + id: notNew.join(',') + }), true)); + } if (singular()) { inspector = iD.ui.Inspector(context, singular())