Skip to content

Commit fd43071

Browse files
committed
added showConsoleDebug option
1 parent c3ec995 commit fd43071

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ Options shall be passed as an object to the `vs-repeat` attribute e.g.:
107107
- `scrolled-to-end-offset` - set this number to trigger the scrolledToEnd callback n items before the last gets rendered
108108
- `scrolled-to-beginning` - callback will be called when the first item of the list is rendered
109109
- `scrolled-to-beginning-offset` - set this number to trigger the scrolledToBeginning callback n items before the first gets rendered
110+
- `show-console-debug` - if false, suppresses debug messages in console (defaults to true)
110111

111112
### EVENTS:
112113
- `vsRepeatTrigger` - an event the directive listens for to manually trigger reinitialization

src/angular-vs-repeat.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
* `scrolled-to-end-offset` - set this number to trigger the scrolledToEnd callback n items before the last gets rendered
7575
* `scrolled-to-beginning` - callback will be called when the first item of the list is rendered
7676
* `scrolled-to-beginning-offset` - set this number to trigger the scrolledToBeginning callback n items before the first gets rendered
77+
* `show-console-debug` - if false, suppresses debug messages in console (defaults to true)
7778
7879
* EVENTS:
7980
* - `vsRepeatTrigger` - an event the directive listens for to manually trigger reinitialization
@@ -182,6 +183,7 @@
182183
autoresize: false,
183184
hunked: false,
184185
hunkSize: 0,
186+
showConsoleDebug: true,
185187
};
186188

187189
const vsRepeatModule = angular.module('vs-repeat', []).directive('vsRepeat', ['$compile', '$parse', function($compile, $parse) {
@@ -568,7 +570,7 @@
568570
__startIndex = 0;
569571
__endIndex = 1;
570572
} else {
571-
_warnMismatch();
573+
if(options.showConsoleDebug) { _warnMismatch(); }
572574

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

0 commit comments

Comments
 (0)