<p dir="auto">Second part of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="3293346106" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/6291" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/6291/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/pull/6291">#6291</a>.</p>
<p dir="auto">Perhaps the event handler initialization would be better located in something like <code class="notranslate">OSM.initializeContextMenu</code>.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/openstreetmap/openstreetmap-website/pull/6295'>https://github.com/openstreetmap/openstreetmap-website/pull/6295</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/6295/commits/3a149701ff693e7c4f70d137b4ac2f44eaf63a56" class="commit-link">3a14970</a>  Move controller invoking event handlers outside said controllers</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/6295/commits/aae683672e0160e91dd9002843e8d2506a8df3b0" class="commit-link">aae6836</a>  Instantiate controller only once needed</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/6295/files">5 files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6295/files#diff-cdc070ced1c4000efd1e28357fd26b2fd617d7fccfeae0324222231db75dd6ee">app/assets/javascripts/index.js</a>
    (82)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6295/files#diff-08fd2f80528286cf96375b12d81cac98954dee8e6a6899f5f261a127861fdd49">app/assets/javascripts/index/new_note.js</a>
    (9)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6295/files#diff-8275a6df0995b2af17f0b52a0dfe5a00f8b09d9d51b89516e2612a3faa9d8c0f">app/assets/javascripts/index/query.js</a>
    (47)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6295/files#diff-8859067d4860f7b3d870155d8af8c81e89fd7c66cd2ebb58bd42cf31005c3c27">app/assets/javascripts/index/search.js</a>
    (32)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6295/files#diff-3635093596ec53c4cebe7c2263939a5b01c8b9c71462506873f73af8429cabbc">app/assets/javascripts/router.js</a>
    (7)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/6295.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/6295.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/6295.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/6295.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6295">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLNF2GTEUJUYIMKZQXT3MENE7AVCNFSM6AAAAACDGDWSEWVHI2DSMVQWIX3LMV43ASLTON2WKOZTGI4TINBXGEYDKMA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLMW3VSY36AE2DVCD733MENE7A5CNFSM6AAAAACDGDWSEWWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHMIXNDRI.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/6295</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/6295",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/6295",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>