|
1 | | -{% do pimcore_head_script().appendFile(asset('/bundles/web2printtools/vendor/js/awesomizr.js')) %} |
2 | | - |
3 | 1 | {% if not editmode %} |
4 | | - <script type="text/javascript"> |
5 | | -
|
6 | | - $(document).ready(function() { |
7 | | - Awesomizr.createTableOfContents({ |
8 | | - /* toc container */ |
9 | | - insertiontarget: '#toc-wrapper', |
10 | | - insertiontype: 'beforeend', |
11 | | - /* levels to look for and link to in toc*/ |
12 | | - elements: ['h1','h2'], |
13 | | - /* container element for the toc */ |
14 | | - container: {tag: 'ul', addClass: 'toc'}, |
15 | | - /* container element for one line in the toc */ |
16 | | - line: {tag: 'li'}, |
17 | | - disabledocumenttitle: true, |
18 | | - toctitle: ' ', |
19 | | -
|
20 | | - /* method of getting the text for the toc lines */ |
21 | | - text: function (elem) { |
22 | | - return elem.textContent; |
23 | | - } |
24 | | - }); |
| 2 | + {% do pimcore_inline_script().appendFile(asset('/bundles/web2printtools/vendor/js/awesomizr.js')) %} |
| 3 | + |
| 4 | + {% set inlineScript %} |
| 5 | + $(document).ready(function() { |
| 6 | + Awesomizr.createTableOfContents({ |
| 7 | + /* toc container */ |
| 8 | + insertiontarget: '#toc-wrapper', |
| 9 | + insertiontype: 'beforeend', |
| 10 | + /* levels to look for and link to in toc*/ |
| 11 | + elements: ['h1','h2'], |
| 12 | + /* container element for the toc */ |
| 13 | + container: {tag: 'ul', addClass: 'toc'}, |
| 14 | + /* container element for one line in the toc */ |
| 15 | + line: {tag: 'li'}, |
| 16 | + disabledocumenttitle: true, |
| 17 | + toctitle: ' ', |
| 18 | + |
| 19 | + /* method of getting the text for the toc lines */ |
| 20 | + text: function (elem) { |
| 21 | + return elem.textContent; |
| 22 | + } |
| 23 | + }); |
25 | 24 |
|
26 | | - }); |
| 25 | + }); |
| 26 | + {% endset %} |
| 27 | + {% do pimcore_inline_script().appendScript(inlineScript) %} |
27 | 28 |
|
28 | | - </script> |
29 | 29 | {% endif %} |
30 | 30 |
|
31 | 31 |
|
|
0 commit comments