diff options
Diffstat (limited to 'docs/src/templates/doc_widgets.js')
| -rw-r--r-- | docs/src/templates/doc_widgets.js | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/docs/src/templates/doc_widgets.js b/docs/src/templates/doc_widgets.js index bfa8e5d0..75cea1be 100644 --- a/docs/src/templates/doc_widgets.js +++ b/docs/src/templates/doc_widgets.js @@ -29,17 +29,22 @@ scenario = element.find('doc\\:scenario').eq(0); var code = indent(exampleSrc); - var tabs = angular.element( - '<ul class="doc-example">' + - '<li class="doc-example-heading"><h3>Source</h3></li>' + - '<li class="doc-example-source" ng:non-bindable>' + - '<pre class="brush: js; html-script: true; highlight: [' + - code.hilite + ']; toolbar: false;"></pre></li>' + - '<li class="doc-example-heading"><h3>Live Preview</h3></li>' + - '<li class="doc-example-live">' + exampleSrc +'</li>' + - '<li class="doc-example-heading"><h3>Scenario Test</h3></li>' + - '<li class="doc-example-scenario"><pre class="brush: js">' + scenario.text() + '</pre></li>' + - '</ul>'); + var tabHtml = + '<ul class="doc-example">' + + '<li class="doc-example-heading"><h3>Source</h3></li>' + + '<li class="doc-example-source" ng:non-bindable>' + + '<pre class="brush: js; html-script: true; highlight: [' + + code.hilite + ']; toolbar: false;"></pre></li>' + + '<li class="doc-example-heading"><h3>Live Preview</h3></li>' + + '<li class="doc-example-live">' + exampleSrc +'</li>'; + if (scenario.text()) { + tabHtml += + '<li class="doc-example-heading"><h3>Scenario Test</h3></li>' + + '<li class="doc-example-scenario"><pre class="brush: js">' + scenario.text() + '</pre></li>'; + } + tabHtml += + '</ul>'; + var tabs = angular.element(tabHtml); tabs.find('li.doc-example-source > pre').text(HTML_TEMPLATE.replace('_HTML_SOURCE_', code.html)); |
