Skip to content

Commit

Permalink
add debounceImmediate to config
Browse files Browse the repository at this point in the history
  • Loading branch information
krispo committed Apr 21, 2016
1 parent f9141b1 commit aee9f6f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ Then build using [grunt](http://gruntjs.com/) (*node.js must be installed*):

## Release Notes

### 1.0.7-dev
* added `debounceImmediate` flag

### [1.0.6](https://github.com/krispo/angular-nvd3/releases/tag/v1.0.6)
* merged with nvd3 1.8.2
* fixed travis
Expand Down
7 changes: 4 additions & 3 deletions dist/angular-nvd3.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**************************************************************************
* AngularJS-nvD3, v1.0.6; MIT License
* AngularJS-nvD3, v1.0.7-dev; MIT License
* http://krispo.github.io/angular-nvd3
**************************************************************************/
(function(){
Expand Down Expand Up @@ -28,7 +28,8 @@
deepWatchOptions: true,
deepWatchData: true,
deepWatchDataDepth: 2, // 0 - by reference (cheap), 1 - by collection item (the middle), 2 - by value (expensive)
debounce: 10 // default 10ms, time silence to prevent refresh while multiple options changes at a time
debounce: 10, // default 10ms, time silence to prevent refresh while multiple options changes at a time
debounceImmediate: true // immediate flag for debounce function
};

//flag indicates if directive and chart is ready
Expand Down Expand Up @@ -407,7 +408,7 @@
if (scope._config.deepWatchOptions) {
scope.$watch('options', nvd3Utils.debounce(function(newOptions){
if (!scope._config.disabled) scope.api.refresh();
}, scope._config.debounce, true), true);
}, scope._config.debounce, scope._config.debounceImmediate), true);
}

// Watching on data changing
Expand Down
Loading

0 comments on commit aee9f6f

Please sign in to comment.