Skip to content

Commit

Permalink
Fixed dropdown nav bug for touch devices.
Browse files Browse the repository at this point in the history
tested by emulating  iPad2/3/4/Mini, iPhone4/5, Nexus5/7
  • Loading branch information
tomwayson committed May 1, 2014
1 parent bfeaf3b commit 8b2186a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions demo/dojo/maps.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@
</script>
<script src="http://js.arcgis.com/3.9compact"></script>
<script>
require(["esri/map", "esri/dijit/Scalebar", "application/bootstrapmap", "dojo/query", "bootstrap/Collapse", "bootstrap/Dropdown", "dojo/domReady!"],
function(Map, Scalebar, BootstrapMap, query) {
require(["esri/map", "esri/dijit/Scalebar", "application/bootstrapmap", "dojo/query", "dojo/touch", "bootstrap/Collapse", "bootstrap/Dropdown", "dojo/domReady!"],
function(Map, Scalebar, BootstrapMap, query, touch) {
// <!-- Get a reference to the ArcGIS Map class -->
var map = BootstrapMap.create("mapDiv",{
basemap:"national-geographic",
Expand All @@ -111,7 +111,8 @@
scalebarUnit: "dual"
});

query("#basemapList li").on("click", function(e) {
query("#basemapList li").on(touch.press, function(e) {
e.preventDefault();
switch (e.target.text) {
case "Streets":
map.setBasemap("streets");
Expand All @@ -133,6 +134,7 @@
break;
}
if (query(".navbar-collapse.in").length > 0) {
e.stopPropagation();
query(".navbar-toggle")[0].click();
}
});
Expand Down

0 comments on commit 8b2186a

Please sign in to comment.