Hide progress bar after 300ms

This commit is contained in:
ZeroNet 2016-08-10 12:27:37 +02:00
parent 10b46db524
commit 70cf67498b

View file

@ -1,14 +1,19 @@
class Loading class Loading
constructor: -> constructor: ->
if window.show_loadingscreen then @showScreen() if window.show_loadingscreen then @showScreen()
@timer_hide = null
setProgress: (percent) -> setProgress: (percent) ->
if @timer_hide
clearInterval @timer_hide
$(".progressbar").css("width", percent*100+"%").css("opacity", "1").css("display", "block") $(".progressbar").css("width", percent*100+"%").css("opacity", "1").css("display", "block")
hideProgress: -> hideProgress: ->
console.log "hideProgress" console.log "hideProgress"
$(".progressbar").css("width", "100%").css("opacity", "0").hideLater(1000) @timer_hide = setTimeout ( =>
$(".progressbar").css("width", "100%").css("opacity", "0").hideLater(1000)
), 300
showScreen: -> showScreen: ->