Permalink
Browse files

Set onload handler via jquery, use local doc pages for preview

  • Loading branch information...
1 parent 2a4db39 commit fa63741ab30f9e9f7a87b5748320134e7638601f @kristi committed Jul 31, 2012
Showing with 3 additions and 4 deletions.
  1. +2 −3 beta/jstest-tmpl.js
  2. +1 −1 index.html
View
@@ -123,7 +123,7 @@ function doQuery() {
console.log(showArr.length);
var links = $("#links").jqotesub("#link-template", showArr);
if (showArr.length >= 1) {
- links.children().first().jqoteapp("#ref-template", showArr[0]);
+ links.children().first().jqoteapp("#ref-template", showArr[0]).find("iframe").load(hackFocus);
}
console.log("done");
return false;
@@ -138,9 +138,8 @@ function initDataFilename() {
}
}
-function hackFocus() {
+function hackFocus(e) {
window.scrollTo(0, 0);
- //$("#search").focus();
}
$(function() {
View
@@ -87,7 +87,7 @@ <h1 class="header">Command Py</h1>
<a href="http://docs.python.org/2.7/<%= this.href %>" title="<%= this.title %>" data-score="<%= this.score %>"><%= this.highlighted %></a><br/>
</script>
<script id="ref-template" type="text/html">
- <div class="ref"><iframe onload="hackFocus()" src="http://docs.python.org/2.7/<%= this.href %>" ></iframe></div>
+ <div class="ref"><iframe src="2.7/<%= this.href %>" ></iframe></div>
</script>
<script src="beta/jquery-1.7.2.js"></script>

0 comments on commit fa63741

Please sign in to comment.