More reliable globe loading
This commit is contained in:
parent
5a234745fc
commit
6f63303781
1 changed files with 10 additions and 7 deletions
|
@ -107,11 +107,15 @@ class Sidebar extends Class
|
||||||
@setSiteInfo(site_info)
|
@setSiteInfo(site_info)
|
||||||
@original_set_site_info.apply(wrapper, arguments)
|
@original_set_site_info.apply(wrapper, arguments)
|
||||||
|
|
||||||
setSiteInfo: (site_info) ->
|
# Preload world.jpg
|
||||||
RateLimit 1000, =>
|
img = new Image();
|
||||||
@updateHtmlTag()
|
img.src = "/uimedia/globe/world.jpg";
|
||||||
@displayGlobe()
|
|
||||||
|
|
||||||
|
setSiteInfo: (site_info) ->
|
||||||
|
RateLimit 3000, =>
|
||||||
|
@updateHtmlTag()
|
||||||
|
RateLimit 30000, =>
|
||||||
|
@displayGlobe()
|
||||||
|
|
||||||
# Create the sidebar html tag
|
# Create the sidebar html tag
|
||||||
createHtmltag: ->
|
createHtmltag: ->
|
||||||
|
@ -133,6 +137,7 @@ class Sidebar extends Class
|
||||||
@log "Creating content"
|
@log "Creating content"
|
||||||
morphdom(@tag.find(".content")[0], '<div class="content">'+res+'</div>')
|
morphdom(@tag.find(".content")[0], '<div class="content">'+res+'</div>')
|
||||||
# @scrollable()
|
# @scrollable()
|
||||||
|
@when_loaded.resolve()
|
||||||
|
|
||||||
else # Not first update, patch the html to keep unchanged dom elements
|
else # Not first update, patch the html to keep unchanged dom elements
|
||||||
@log "Patching content"
|
@log "Patching content"
|
||||||
|
@ -143,7 +148,6 @@ class Sidebar extends Class
|
||||||
else
|
else
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@when_loaded.resolve()
|
|
||||||
|
|
||||||
|
|
||||||
animDrag: (e) =>
|
animDrag: (e) =>
|
||||||
|
@ -342,8 +346,7 @@ class Sidebar extends Class
|
||||||
if typeof(DAT) == "undefined" # Globe script not loaded, do it first
|
if typeof(DAT) == "undefined" # Globe script not loaded, do it first
|
||||||
$.getScript("/uimedia/globe/all.js", @displayGlobe)
|
$.getScript("/uimedia/globe/all.js", @displayGlobe)
|
||||||
else
|
else
|
||||||
RateLimit 5000, =>
|
@displayGlobe()
|
||||||
@displayGlobe()
|
|
||||||
), 600
|
), 600
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue