Skip to content

Commit

Permalink
Observe a little more
Browse files Browse the repository at this point in the history
Fixed #4
  • Loading branch information
Rick Pastoor committed Sep 7, 2015
1 parent 8982f6e commit 3bdf862
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scrummer.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ var listChangeObserver = new MutationObserver(function (mutations) {

// If the list was modified, recalculate
if (mutation.target.classList.contains('list-cards') ||
mutation.target.classList.contains('list-header-num-cards')) {
mutation.target.classList.contains('list-header-num-cards') ||
mutation.target.classList.contains('js-list-sortable')) {
setTimeout(calculateStoryPointsForBoardDebounced);
return;
}
Expand Down Expand Up @@ -110,7 +111,6 @@ var calculateStoryPointsForCard = function (card) {
}

var calculateStoryPointsForList = function (list) {
// Observe this list for changes
listChangeObserver.observe(list, {
childList: true,
characterData: false,
Expand Down Expand Up @@ -148,6 +148,12 @@ var calculateStoryPointsForBoard = function () {
for (var i = 0; i < lists.length; i++) {
calculateStoryPointsForList(lists[i]);
}

listChangeObserver.observe(document.querySelector('.js-list-sortable'), {
childList: true,
characterData: false,
attributes: false
});
}

var calculateStoryPointsForBoardDebounced = function () {
Expand Down

0 comments on commit 3bdf862

Please sign in to comment.