Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Commit

Permalink
fix(rows): Fix "deregisterFunction is not a function" error
Browse files Browse the repository at this point in the history
Close #627
  • Loading branch information
Toilal committed Sep 30, 2016
1 parent b1b4223 commit e7d0e44
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
10 changes: 6 additions & 4 deletions assets/angular-gantt.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions demo/dist/scripts/vendor.js
Original file line number Diff line number Diff line change
Expand Up @@ -51053,8 +51053,10 @@ Github: https://github.com/angular-gantt/angular-gantt.git
var indexOf = arrays.indexOfId(this.rows, rowId, ['model', 'id']);
if (indexOf > -1) {
removedRow = this.rows.splice(indexOf, 1)[0]; // Remove from array
var deregisterFunction = this.rowsTaskWatchers.splice(indexOf, 1)[0]; // Remove watcher
deregisterFunction();
var unregisterFunction = this.rowsTaskWatchers.splice(indexOf, 1)[0]; // Remove watcher
if (unregisterFunction) {
unregisterFunction();
}
}

arrays.removeId(this.sortedRows, rowId, ['model', 'id']);
Expand All @@ -51078,8 +51080,8 @@ Github: https://github.com/angular-gantt/angular-gantt.git
this.visibleRows = [];

for (var i = 0, l = this.rowsTaskWatchers.length; i < l; i++) {
var deregisterFunction = this.rowsTaskWatchers[i];
deregisterFunction();
var unregisterFunction = this.rowsTaskWatchers[i];
unregisterFunction();
}
this.rowsTaskWatchers = [];
};
Expand Down
10 changes: 6 additions & 4 deletions src/core/logic/row/rowsManager.factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,10 @@
var indexOf = arrays.indexOfId(this.rows, rowId, ['model', 'id']);
if (indexOf > -1) {
removedRow = this.rows.splice(indexOf, 1)[0]; // Remove from array
var deregisterFunction = this.rowsTaskWatchers.splice(indexOf, 1)[0]; // Remove watcher
deregisterFunction();
var unregisterFunction = this.rowsTaskWatchers.splice(indexOf, 1)[0]; // Remove watcher
if (unregisterFunction) {
unregisterFunction();
}
}

arrays.removeId(this.sortedRows, rowId, ['model', 'id']);
Expand All @@ -216,8 +218,8 @@
this.visibleRows = [];

for (var i = 0, l = this.rowsTaskWatchers.length; i < l; i++) {
var deregisterFunction = this.rowsTaskWatchers[i];
deregisterFunction();
var unregisterFunction = this.rowsTaskWatchers[i];
unregisterFunction();
}
this.rowsTaskWatchers = [];
};
Expand Down

0 comments on commit e7d0e44

Please sign in to comment.