Skip to content

Commit d64dd4f

Browse files
eddiemongejohnbender
authored andcommitted
Allow unlimited sub-directory replacements
1 parent 92e198c commit d64dd4f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

docs/_assets/js/jqm-docs.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,13 @@ if ( location.protocol.substr(0,4) === 'file' ||
6060
location.protocol.substr(0,11) === '*-extension' ||
6161
location.protocol.substr(0,6) === 'widget' ) {
6262
$( function() {
63+
// Check to see if ajax can be used. This does a quick ajax request and blocks the page until its done
64+
// Start with links with only the trailing slash, and then move on to the ones that start with ..
6365
$( "a" )
64-
.filter( "[href='../']" ).attr( "href", "../index.html" ).end()
65-
.filter( "[href='../../']" ).attr( "href", "../../index.html" ).end()
66-
.filter( "[href='../../../']" ).attr( "href", "../../../index.html" );
66+
.filter( "[href='/']" ).attr( "href", "/index.html" ).end()
67+
.filter( "[href^='..']" ).filter( "[href$='/']" ).each(function() {
68+
this.href = $(this).attr("href")+"index.html";
69+
});
6770
});
6871

6972
// Check to see if ajax can be used. This does a quick ajax request and blocks the page until its done

0 commit comments

Comments
 (0)