Add debounceLeading to issueslist and taskbord

stable
Álex Hermida 2018-06-26 12:02:22 +02:00
parent 0f8aa7514f
commit 926001a571
3 changed files with 7 additions and 6 deletions

View File

@ -33,6 +33,7 @@ bindOnce = @.taiga.bindOnce
debounceLeading = @.taiga.debounceLeading
startswith = @.taiga.startswith
bindMethods = @.taiga.bindMethods
debounceLeading = @.taiga.debounceLeading
module = angular.module("taigaIssues")
@ -309,9 +310,8 @@ class IssuesController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
initializeSubscription: ->
routingKey = "changes.project.#{@scope.projectId}.issues"
@events.subscribe @scope, routingKey, (message) =>
@.loadIssues()
@events.subscribe @scope, routingKey, debounceLeading(500, (message) =>
@.loadIssues())
loadProject: ->
project = @projectService.project.toJS()

View File

@ -343,7 +343,7 @@ class KanbanController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
initializeSubscription: ->
routingKey1 = "changes.project.#{@scope.projectId}.userstories"
@events.subscribe @scope, routingKey1, debounceLeading(300, (message) =>
@events.subscribe @scope, routingKey1, debounceLeading(500, (message) =>
@.loadUserstories())
loadInitialData: ->

View File

@ -30,6 +30,7 @@ bindOnce = @.taiga.bindOnce
scopeDefer = @.taiga.scopeDefer
timeout = @.taiga.timeout
bindMethods = @.taiga.bindMethods
debounceLeading = @.taiga.debounceLeading
module = angular.module("taigaTaskboard")
@ -326,8 +327,8 @@ class TaskboardController extends mixOf(taiga.Controller, taiga.PageMixin, taiga
initializeSubscription: ->
routingKey = "changes.project.#{@scope.projectId}.tasks"
@events.subscribe @scope, routingKey, (message) =>
@.loadTaskboard()
@events.subscribe @scope, routingKey, debounceLeading(500, (message) =>
@.loadTaskboard())
routingKey1 = "changes.project.#{@scope.projectId}.userstories"
@events.subscribe @scope, routingKey1, (message) =>