Work around for iOS web app links opening in Safari

This commit is contained in:
JonnyWong16 2016-01-19 00:06:14 -08:00
commit 196048cf38
2 changed files with 17 additions and 2 deletions

View file

@ -261,6 +261,21 @@ ${next.headerIncludes()}
}
});
</script>
<script>
// Work around for iOS web app links opening in Safari
$(document).ready(function () {
if (("standalone" in window.navigator) && window.navigator.standalone) {
// For iOS Apps
$('a').on('click', function (e) {
e.preventDefault();
var new_location = $(this).attr('href');
if (new_location != undefined && new_location.substr(0, 1) != '#' && $(this).attr('data-method') == undefined) {
window.location = new_location;
}
});
}
});
</script>
${next.javascriptIncludes()}
</body>
</html>