Merge pull request #1476 from alexhermida/ft/add_debounce

Fix debounce in Kanban,Taskboard, IssuesList
stable
Miguel Gonzalez 2018-06-26 17:26:15 +02:00 committed by GitHub
commit 7bd0bf7872
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 8 deletions

View File

@ -204,7 +204,7 @@ class EventsService
subscription = {
scope: scope,
routingKey: routingKey,
callback: _.debounce(callback, 500, {"leading": true, "trailing": false})
callback: callback
}
message = {

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

@ -31,6 +31,7 @@ bindOnce = @.taiga.bindOnce
groupBy = @.taiga.groupBy
timeout = @.taiga.timeout
bindMethods = @.taiga.bindMethods
debounceLeading = @.taiga.debounceLeading
module = angular.module("taigaKanban")
@ -342,8 +343,8 @@ class KanbanController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
initializeSubscription: ->
routingKey1 = "changes.project.#{@scope.projectId}.userstories"
@events.subscribe @scope, routingKey1, (message) =>
@.loadUserstories()
@events.subscribe @scope, routingKey1, debounceLeading(500, (message) =>
@.loadUserstories())
loadInitialData: ->
project = @.loadProject()

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) =>