aboutsummaryrefslogtreecommitdiffstats
path: root/docs/src/templates/doc_widgets.js
diff options
context:
space:
mode:
authorDi Peng2011-07-14 18:28:15 -0700
committerIgor Minar2011-07-17 22:19:08 -0700
commitf9b4c9da648f81aef1fbee41d24822e420eb56f9 (patch)
tree35d40aeda6d1aca27d4b283faf8d84a776b0a141 /docs/src/templates/doc_widgets.js
parent83ac1193f2322f71f314e7e160af46142b01a290 (diff)
downloadangular.js-f9b4c9da648f81aef1fbee41d24822e420eb56f9.tar.bz2
refactor(docs): run e2e tests with and without jquery
- e2e tests will run index.html (without jquery) and with index-jq.html(with jquery). - many small changes to make e2e tests work withough JQuery as we discover problems that were previously hidden by using real JQuery.
Diffstat (limited to 'docs/src/templates/doc_widgets.js')
-rw-r--r--docs/src/templates/doc_widgets.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/docs/src/templates/doc_widgets.js b/docs/src/templates/doc_widgets.js
index 5516da26..c995857c 100644
--- a/docs/src/templates/doc_widgets.js
+++ b/docs/src/templates/doc_widgets.js
@@ -25,9 +25,11 @@
this.descend(true); //compile the example code
element.hide();
- var example = element.find('pre.doc-source').eq(0),
+ //jQuery find() methods in this widget contain primitive selectors on purpose so that we can use
+ //jqlite instead. jqlite's find() method currently supports onlt getElementsByTagName!
+ var example = element.find('pre').eq(0), //doc-source
exampleSrc = example.text(),
- scenario = element.find('pre.doc-scenario').eq(0);
+ scenario = element.find('pre').eq(1); //doc-scenario
var code = indent(exampleSrc);
var tabHtml =
@@ -47,7 +49,7 @@
'</ul>';
var tabs = angular.element(tabHtml);
- tabs.find('li.doc-example-source > pre').text(HTML_TEMPLATE.replace('_HTML_SOURCE_', code.html));
+ tabs.find('li').eq(1).find('pre').text(HTML_TEMPLATE.replace('_HTML_SOURCE_', code.html));
element.html('');
element.append(tabs);
@@ -55,7 +57,7 @@
var script = (exampleSrc.match(/<script[^\>]*>([\s\S]*)<\/script>/) || [])[1] || '';
try {
- eval(script);
+ window.eval(script);
} catch (e) {
alert(e);
}