Update debounce to random timeout
parent
dc41c1ebbd
commit
008b04f309
|
@ -345,7 +345,8 @@ class KanbanController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
|
||||||
|
|
||||||
initializeSubscription: ->
|
initializeSubscription: ->
|
||||||
routingKey1 = "changes.project.#{@scope.projectId}.userstories"
|
routingKey1 = "changes.project.#{@scope.projectId}.userstories"
|
||||||
@events.subscribe @scope, routingKey1, debounceLeading(500, (message) =>
|
randomTimeout = taiga.randomInt(700, 1000)
|
||||||
|
@events.subscribe @scope, routingKey1, debounceLeading(randomTimeout, (message) =>
|
||||||
@.loadUserstories())
|
@.loadUserstories())
|
||||||
|
|
||||||
loadInitialData: ->
|
loadInitialData: ->
|
||||||
|
|
|
@ -266,6 +266,10 @@ getMatches = (string, regex, index) ->
|
||||||
|
|
||||||
return matches
|
return matches
|
||||||
|
|
||||||
|
randomInt = (start, end) ->
|
||||||
|
interval = end - start
|
||||||
|
return start + Math.floor(Math.random()*(interval+1))
|
||||||
|
|
||||||
taiga = @.taiga
|
taiga = @.taiga
|
||||||
taiga.addClass = addClass
|
taiga.addClass = addClass
|
||||||
taiga.nl2br = nl2br
|
taiga.nl2br = nl2br
|
||||||
|
@ -297,3 +301,4 @@ taiga.patch = patch
|
||||||
taiga.getRandomDefaultColor = getRandomDefaultColor
|
taiga.getRandomDefaultColor = getRandomDefaultColor
|
||||||
taiga.getDefaulColorList = getDefaulColorList
|
taiga.getDefaulColorList = getDefaulColorList
|
||||||
taiga.getMatches = getMatches
|
taiga.getMatches = getMatches
|
||||||
|
taiga.randomInt = randomInt
|
||||||
|
|
Loading…
Reference in New Issue