Skip to content

Commit 5d34165

Browse files
simonistaBenjamin Christian Nelson
authored andcommitted
Revert "stop wrapping our custom js loading in a require block"
This reverts commit 78268a8. fixes CNVS-30696 test plan: - add a custom account js include - make sure it loads properly all the time Change-Id: Ie708c17c7d27c6caaf46a79df115557737701286 Reviewed-on: https://gerrit.instructure.com/86596 Tested-by: Jenkins Reviewed-by: John Corrigan <jcorrigan@instructure.com> QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com> Product-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
1 parent 48229cd commit 5d34165

1 file changed

Lines changed: 7 additions & 13 deletions

File tree

app/helpers/application_helper.rb

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -796,19 +796,13 @@ def include_account_js(options = {})
796796
javascript_include_tag(*includes)
797797
else
798798
str = <<-ENDSCRIPT
799-
!function(){
800-
function tryToLoadAccountJS () {
801-
// wait to make sure jquery is loaded before loading account js
802-
if (!$) return setTimeout(tryToLoadAccountJS, 20);
803-
804-
#{includes.to_json}.forEach(function (src) {
805-
var s = document.createElement('script');
806-
s.src = src;
807-
document.body.appendChild(s);
808-
});
809-
}
810-
tryToLoadAccountJS();
811-
}();
799+
require(['jquery'], function () {
800+
#{includes.to_json}.forEach(function (src) {
801+
var s = document.createElement('script');
802+
s.src = src;
803+
document.body.appendChild(s);
804+
});
805+
});
812806
ENDSCRIPT
813807
javascript_tag(str)
814808
end

0 commit comments

Comments
 (0)