Skip to content

Commit

Permalink
added showConsoleDebug option
Browse files Browse the repository at this point in the history
  • Loading branch information
Liooo committed Apr 3, 2018
1 parent c3ec995 commit fd43071
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ Options shall be passed as an object to the `vs-repeat` attribute e.g.:
- `scrolled-to-end-offset` - set this number to trigger the scrolledToEnd callback n items before the last gets rendered
- `scrolled-to-beginning` - callback will be called when the first item of the list is rendered
- `scrolled-to-beginning-offset` - set this number to trigger the scrolledToBeginning callback n items before the first gets rendered
- `show-console-debug` - if false, suppresses debug messages in console (defaults to true)

### EVENTS:
- `vsRepeatTrigger` - an event the directive listens for to manually trigger reinitialization
Expand Down
4 changes: 3 additions & 1 deletion src/angular-vs-repeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
* `scrolled-to-end-offset` - set this number to trigger the scrolledToEnd callback n items before the last gets rendered
* `scrolled-to-beginning` - callback will be called when the first item of the list is rendered
* `scrolled-to-beginning-offset` - set this number to trigger the scrolledToBeginning callback n items before the first gets rendered
* `show-console-debug` - if false, suppresses debug messages in console (defaults to true)
* EVENTS:
* - `vsRepeatTrigger` - an event the directive listens for to manually trigger reinitialization
Expand Down Expand Up @@ -182,6 +183,7 @@
autoresize: false,
hunked: false,
hunkSize: 0,
showConsoleDebug: true,
};

const vsRepeatModule = angular.module('vs-repeat', []).directive('vsRepeat', ['$compile', '$parse', function($compile, $parse) {
Expand Down Expand Up @@ -568,7 +570,7 @@
__startIndex = 0;
__endIndex = 1;
} else {
_warnMismatch();
if(options.showConsoleDebug) { _warnMismatch(); }

const relativeScroll = $scrollPosition - options.offsetBefore - scrollOffset;

Expand Down

0 comments on commit fd43071

Please sign in to comment.