Skip to content

Commit

Permalink
Replace deprecated .size() with .length
Browse files Browse the repository at this point in the history
  • Loading branch information
jsor committed Nov 12, 2013
1 parent 580a4e7 commit 992ddaa
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 58 deletions.
26 changes: 13 additions & 13 deletions dist/jquery.jcarousel-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@
jCarousel.detectCarousel = function(element) {
var carousel;

while (element.size() > 0) {
while (element.length > 0) {
carousel = element.filter('[data-jcarousel]');

if (carousel.size() > 0) {
if (carousel.length > 0) {
return carousel;
}

carousel = element.find('[data-jcarousel]');

if (carousel.size() > 0) {
if (carousel.length > 0) {
return carousel;
}

Expand Down Expand Up @@ -336,14 +336,14 @@

var props = {'left': 0, 'top': 0};

if (item.size() > 0) {
if (item.length > 0) {
this._prepare(item);
this.list().find('[data-jcarousel-clone]').remove();

// Force items reload
this._items = null;

this.underflow = this._fullyvisible.size() >= this.items().size();
this.underflow = this._fullyvisible.length >= this.items().length;
this.circular = this.circular && !this.underflow;

props[this.lt] = this._position(item) + 'px';
Expand Down Expand Up @@ -429,7 +429,7 @@
}

var wrap = this.options('wrap'),
end = this.items().size() - 1;
end = this.items().length - 1;

return end >= 0 &&
((wrap && wrap !== 'first') ||
Expand All @@ -443,7 +443,7 @@

var wrap = this.options('wrap');

return this.items().size() > 0 &&
return this.items().length > 0 &&
((wrap && wrap !== 'last') ||
(this.index(this._first) > 0) ||
(this.tail && this.inTail)) ? true : false;
Expand Down Expand Up @@ -471,7 +471,7 @@
var parsed = $.jCarousel.parseTarget(target);

if (parsed.relative) {
var end = this.items().size() - 1,
var end = this.items().length - 1,
scroll = Math.abs(parsed.target),
wrap = this.options('wrap'),
current,
Expand Down Expand Up @@ -684,7 +684,7 @@
item = $(item);
}

if (item.size() === 0) {
if (item.length === 0) {
if ($.isFunction(callback)) {
callback.call(this, false);
}
Expand Down Expand Up @@ -761,7 +761,7 @@

var c = this.list().find('[data-jcarousel-clone]');

if (c.size() > 0) {
if (c.length > 0) {
c.remove();
this._reload();
}
Expand Down Expand Up @@ -818,7 +818,7 @@
while (true) {
curr = this.items().eq(++idx);

if (curr.size() === 0) {
if (curr.length === 0) {
if (!this.circular) {
break;
}
Expand Down Expand Up @@ -875,7 +875,7 @@

curr = this.items().eq(idx);

if (curr.size() === 0) {
if (curr.length === 0) {
break;
}

Expand Down Expand Up @@ -904,7 +904,7 @@
if (!center &&
this.options('wrap') !== 'circular' &&
this.options('wrap') !== 'custom' &&
this.index(update.last) === (this.items().size() - 1)) {
this.index(update.last) === (this.items().length - 1)) {

// Remove right/bottom margin from total width
wh -= toFloat(update.last.css('margin-' + lrb));
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.jcarousel-core.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/jquery.jcarousel-pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
while (true) {
curr = items.eq(i++);

if (curr.size() === 0) {
if (curr.length === 0) {
break;
}

Expand Down Expand Up @@ -100,11 +100,11 @@

if (parseFloat(page) > parseFloat(self._currentPage)) {
if (newIndex < currentIndex) {
target = '+=' + (carousel.items().size() - currentIndex + newIndex);
target = '+=' + (carousel.items().length - currentIndex + newIndex);
}
} else {
if (newIndex > currentIndex) {
target = '-=' + (currentIndex + (carousel.items().size() - newIndex));
target = '-=' + (currentIndex + (carousel.items().length - newIndex));
}
}
}
Expand Down Expand Up @@ -161,7 +161,7 @@
while (true) {
curr = items.eq(idx++);

if (curr.size() === 0) {
if (curr.length === 0) {
break;
}

Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.jcarousel-pagination.min.js

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

2 changes: 1 addition & 1 deletion dist/jquery.jcarousel-scrollintoview.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
while (true) {
curr = items.eq(index);

if (curr.size() === 0) {
if (curr.length === 0) {
break;
}

Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.jcarousel-scrollintoview.min.js

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

36 changes: 18 additions & 18 deletions dist/jquery.jcarousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@
jCarousel.detectCarousel = function(element) {
var carousel;

while (element.size() > 0) {
while (element.length > 0) {
carousel = element.filter('[data-jcarousel]');

if (carousel.size() > 0) {
if (carousel.length > 0) {
return carousel;
}

carousel = element.find('[data-jcarousel]');

if (carousel.size() > 0) {
if (carousel.length > 0) {
return carousel;
}

Expand Down Expand Up @@ -336,14 +336,14 @@

var props = {'left': 0, 'top': 0};

if (item.size() > 0) {
if (item.length > 0) {
this._prepare(item);
this.list().find('[data-jcarousel-clone]').remove();

// Force items reload
this._items = null;

this.underflow = this._fullyvisible.size() >= this.items().size();
this.underflow = this._fullyvisible.length >= this.items().length;
this.circular = this.circular && !this.underflow;

props[this.lt] = this._position(item) + 'px';
Expand Down Expand Up @@ -429,7 +429,7 @@
}

var wrap = this.options('wrap'),
end = this.items().size() - 1;
end = this.items().length - 1;

return end >= 0 &&
((wrap && wrap !== 'first') ||
Expand All @@ -443,7 +443,7 @@

var wrap = this.options('wrap');

return this.items().size() > 0 &&
return this.items().length > 0 &&
((wrap && wrap !== 'last') ||
(this.index(this._first) > 0) ||
(this.tail && this.inTail)) ? true : false;
Expand Down Expand Up @@ -471,7 +471,7 @@
var parsed = $.jCarousel.parseTarget(target);

if (parsed.relative) {
var end = this.items().size() - 1,
var end = this.items().length - 1,
scroll = Math.abs(parsed.target),
wrap = this.options('wrap'),
current,
Expand Down Expand Up @@ -684,7 +684,7 @@
item = $(item);
}

if (item.size() === 0) {
if (item.length === 0) {
if ($.isFunction(callback)) {
callback.call(this, false);
}
Expand Down Expand Up @@ -761,7 +761,7 @@

var c = this.list().find('[data-jcarousel-clone]');

if (c.size() > 0) {
if (c.length > 0) {
c.remove();
this._reload();
}
Expand Down Expand Up @@ -818,7 +818,7 @@
while (true) {
curr = this.items().eq(++idx);

if (curr.size() === 0) {
if (curr.length === 0) {
if (!this.circular) {
break;
}
Expand Down Expand Up @@ -875,7 +875,7 @@

curr = this.items().eq(idx);

if (curr.size() === 0) {
if (curr.length === 0) {
break;
}

Expand Down Expand Up @@ -904,7 +904,7 @@
if (!center &&
this.options('wrap') !== 'circular' &&
this.options('wrap') !== 'custom' &&
this.index(update.last) === (this.items().size() - 1)) {
this.index(update.last) === (this.items().length - 1)) {

// Remove right/bottom margin from total width
wh -= toFloat(update.last.css('margin-' + lrb));
Expand Down Expand Up @@ -1024,7 +1024,7 @@
while (true) {
curr = items.eq(index);

if (curr.size() === 0) {
if (curr.length === 0) {
break;
}

Expand Down Expand Up @@ -1186,7 +1186,7 @@
while (true) {
curr = items.eq(i++);

if (curr.size() === 0) {
if (curr.length === 0) {
break;
}

Expand Down Expand Up @@ -1222,11 +1222,11 @@

if (parseFloat(page) > parseFloat(self._currentPage)) {
if (newIndex < currentIndex) {
target = '+=' + (carousel.items().size() - currentIndex + newIndex);
target = '+=' + (carousel.items().length - currentIndex + newIndex);
}
} else {
if (newIndex > currentIndex) {
target = '-=' + (currentIndex + (carousel.items().size() - newIndex));
target = '-=' + (currentIndex + (carousel.items().length - newIndex));
}
}
}
Expand Down Expand Up @@ -1283,7 +1283,7 @@
while (true) {
curr = items.eq(idx++);

if (curr.size() === 0) {
if (curr.length === 0) {
break;
}

Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.jcarousel.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@
jCarousel.detectCarousel = function(element) {
var carousel;

while (element.size() > 0) {
while (element.length > 0) {
carousel = element.filter('[data-jcarousel]');

if (carousel.size() > 0) {
if (carousel.length > 0) {
return carousel;
}

carousel = element.find('[data-jcarousel]');

if (carousel.size() > 0) {
if (carousel.length > 0) {
return carousel;
}

Expand Down
Loading

0 comments on commit 992ddaa

Please sign in to comment.