Skip to content

Commit 0acb58a

Browse files
committed
main: fix the latest versions in the jQuery section
1 parent cc0e28c commit 0acb58a

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

Gruntfile.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,13 @@ grunt.registerTask( "build-index", function() {
305305
return "<a class='open-sri-modal' href='/" + file + "' data-hash='" + sri + "'>" + label + "</a>";
306306
}
307307

308+
Handlebars.registerHelper( "ifeq", function( v1, v2, options ) {
309+
if (v1 === v2) {
310+
return options.fn( this );
311+
}
312+
return options.inverse( this );
313+
} );
314+
308315
Handlebars.registerHelper( "release", function( prefix, release ) {
309316
var html = prefix + " " + release.version + " - " + href( release.filename, "uncompressed" );
310317
if ( release.minified ) {

templates/index.hbs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,14 @@
88
<a href="/jquery/">See all versions of jQuery Core</a>.
99
</p>
1010

11-
{{#with jquery2.latestStable}}
12-
<h3>jQuery 2.x (IE &lt;9 not supported)</h3>
11+
{{#each jquery}}
12+
{{#if this.1.latestStable}}
13+
<h3>jQuery {{this.[0]}}.x{{#ifeq this.[0] '1'}}{{else}} (IE &lt;9 not supported){{/ifeq}}</h3>
1314
<ul>
14-
<li>{{release "jQuery Core" this}}</li>
15+
<li>{{release "jQuery Core" this.1.latestStable}}</li>
1516
</ul>
16-
{{/with}}
17-
18-
{{#with jquery1.latestStable}}
19-
<h3>jQuery 1.x</h3>
20-
<ul>
21-
<li>{{release "jQuery Core" this}}</li>
22-
</ul>
23-
{{/with}}
17+
{{/if}}
18+
{{/each}}
2419

2520
{{#with migrate.latestStable}}
2621
<h3>jQuery Migrate</h3>

0 commit comments

Comments
 (0)