Skip to content

Commit 9616eee

Browse files
committed
BUG: Fix bug with Safari and MOI
Assigning a function to document.ready doesn't seem to be supported in Safari, and thus the call to initialize MOI would never occurr. Using jQuery's proxy for ready seems to resolve this problem. Fixes #946
1 parent 2199bdd commit 9616eee

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

qiita_pet/templates/analysis_waiting.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
<script src="/static/vendor/js/moi.js"></script>
55
<script src="/static/vendor/js/moi_list.js"></script>
66
<script type="text/javascript">
7-
window.onload = function() {moi_list.init("{{group_id}}");};
7+
$(document).ready(function() {
8+
moi_list.init("{{group_id}}");
9+
});
810
</script>
911
{% end %}
1012

qiita_pet/templates/compute_wait.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
{%block head%}
44
<script type="text/javascript">
5-
window.onload = function() {
5+
$(document).ready(function() {
66

77
var host = 'ws://' + window.location.host + '/consumer/';
88
var websocket = new WebSocket(host);
@@ -34,7 +34,7 @@
3434
}
3535
};
3636
websocket.onerror = function(evt) { };
37-
};
37+
});
3838
</script>
3939
{% end %}
4040

0 commit comments

Comments
 (0)