Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add showConsoleDebug option #197

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
angular-vs-repeat v2.0.9
angular-vs-repeat v2.1.0
=================

Looking for a version for Angular 2?
Expand Down 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
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-vs-repeat",
"version": "2.0.9",
"version": "2.1.0",
"description": "Virtual Scroll for AngularJS ngRepeat directive",
"homepage": "http://kamilkp.github.io/angular-vs-repeat",
"main": "dist/angular-vs-repeat.min.js",
Expand Down
10 changes: 7 additions & 3 deletions dist/angular-vs-repeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else i

/**
* Copyright Kamil Pękala http://github.com/kamilkp
* Angular Virtual Scroll Repeat v2.0.9 2018/04/02
* Angular Virtual Scroll Repeat v2.1.0 2018/04/03
*/

/* global console, setTimeout, module */
Expand Down Expand Up @@ -74,6 +74,7 @@ function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else i
* `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
* - `vsRepeatReinitialized` - an event the directive emits upon reinitialization done
Expand Down Expand Up @@ -176,7 +177,8 @@ function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else i
horizontal: false,
autoresize: false,
hunked: false,
hunkSize: 0
hunkSize: 0,
showConsoleDebug: true
};
var vsRepeatModule = angular.module('vs-repeat', []).directive('vsRepeat', ['$compile', '$parse', function ($compile, $parse) {
return {
Expand Down Expand Up @@ -563,7 +565,9 @@ function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else i
__startIndex = 0;
__endIndex = 1;
} else {
_warnMismatch();
if (options.showConsoleDebug) {
_warnMismatch();
}

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

Expand Down
2 changes: 1 addition & 1 deletion dist/angular-vs-repeat.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-vs-repeat",
"version": "2.0.9",
"version": "2.1.0",
"description": "Virtual Scroll for AngularJS ngRepeat directive",
"homepage": "http://kamilkp.github.io/angular-vs-repeat",
"license": "MIT",
Expand Down
6 changes: 4 additions & 2 deletions src/angular-vs-repeat.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Copyright Kamil Pękala http://github.com/kamilkp
* Angular Virtual Scroll Repeat v2.0.9 2018/04/02
* Angular Virtual Scroll Repeat v2.1.0 2018/04/03
*/

/* global console, setTimeout, module */
Expand Down 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