Skip to content

Commit

Permalink
Separate polyfill from helpers in source code
Browse files Browse the repository at this point in the history
  • Loading branch information
dieulot committed Jan 13, 2017
1 parent 56ea7a1 commit 3e2f548
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/instantclick.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ var instantClick
, $delegatedEvents = {}


////////// HELPERS //////////
////////// POLYFILL //////////


/* Polyfill needed for `addEvent` */
/* Needed for `addEvent` */
if (!Element.prototype.matches) {
Element.prototype.matches =
Element.prototype.webkitMatchesSelector ||
Expand All @@ -59,6 +59,10 @@ var instantClick
}
}


////////// HELPERS //////////


function removeHash(url) {
var index = url.indexOf('#')
if (index == -1) {
Expand Down Expand Up @@ -698,6 +702,7 @@ var instantClick

////////// PUBLIC VARIABLE AND FUNCTIONS //////////


var supported = false
if ('pushState' in history
&& location.protocol != "file:") {
Expand Down

0 comments on commit 3e2f548

Please sign in to comment.