summaryrefslogtreecommitdiffstats
path: root/template/en/default/global/js-products.html.tmpl
blob: 940a5e64d09dd368af0a445167a07c56bb7a820f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[%# This Source Code Form is subject to the terms of the Mozilla Public
  # License, v. 2.0. If a copy of the MPL was not distributed with this
  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  #
  # This Source Code Form is "Incompatible With Secondary Licenses", as
  # defined by the Mozilla Public License, v. 2.0.
  #%]

[%# The javascript block gets used in header.html.tmpl. %]
[% javascript = BLOCK %]
  var first_load = true; // Is this the first time we load the page?
  var last_sel = []; // Caches last selection
  var cpts = new Array();

  [% n = 1 %]
  [% FOREACH prod = products %]
    cpts['[% n %]'] = [[% FOREACH comp = prod.components %]'[% comp.name FILTER js %]'[% ", " UNLESS loop.last %] [%- END -%]];
    [% n = n+1 %]
  [% END %]
[% END %]