Skip to content

Commit

Permalink
Fix some issues breaking Safari
Browse files Browse the repository at this point in the history
  • Loading branch information
Yehuda Katz committed Jul 6, 2008
1 parent 22badf2 commit 732fb10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions merb_screw_unit/app/views/layout/merb_screw_unit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</head>
<body>
<iframe id="dom" src="<%= @spec_url %>?<%= MD5.hexdigest(Time.now.to_s) %>" style="display: none"></iframe>
<script>
<script type="text/javascript">
Screw.Unit(function() {
iframeWindow = $("#dom").contents()[0].defaultView;
iframeWindow.XMLHttpRequest = Screw.XHR;
Expand All @@ -19,17 +19,14 @@
queries[i].run();
}
}
};
};

before(function() {
$ = iframeWindow.$;
$.ajaxSettings.async = false;
$.fn.fireEvent = function(event) {
runLivequeries();
this.trigger(event);
this.each(function() {
if($(this).is(":submit")) $(this).parents("form:first").submit();
});
this.trigger(event);
return this;
};
})
Expand Down
2 changes: 1 addition & 1 deletion merb_screw_unit/public/javascripts/screw.builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ var Screw = (function($) {
.appendTo('body');

$(screw).dequeue();
$("#dom").contents()[0].defaultView.onload = function() {
$("#dom")[0].onload = function() {
setTimeout(function() {
$(screw).trigger('loaded');
}, 200);
Expand Down

0 comments on commit 732fb10

Please sign in to comment.