Skip to content

Commit

Permalink
#4: Moved JQuery download before first use of JQuery
Browse files Browse the repository at this point in the history
I feel so dumb
  • Loading branch information
KyNorthstar committed May 13, 2021
1 parent 57cee34 commit 19954e2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions assets/v2/general/js/BHStudios General Scripts.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/v2/general/js/BHStudios General Scripts.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/v2/general/js/BHStudios General Scripts.meta.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
5 changes: 3 additions & 2 deletions assets/v2/general/kt/src/org/bh/scripts/general/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import org.w3c.dom.*


fun main(args: Array<String>) {
Setup.downloadJQuery()

jq(document).ready {
Setup.performCommonPageConnections()
Setup.reloadStates()
Expand All @@ -36,15 +38,14 @@ private object Setup {
// MARK: - Connect

fun performCommonPageConnections() {
downloadJQuery()
connectAllSidebarsToSidebarButtons()
connectAllThemeSwatches()
allowElementReplacers()
connectInputBasedContentTransformers()
}


private fun downloadJQuery() {
fun downloadJQuery() {
if (js("jQuery") === undefined) {
val script = document.createElement("script") as? HTMLScriptElement ?: return console.error("Could not create script element")
script.src = "//code.jquery.com/jquery-3.x-git.slim.min.js"
Expand Down

0 comments on commit 19954e2

Please sign in to comment.