Skip to content

Commit

Permalink
refactor reveal & hide lil bit
Browse files Browse the repository at this point in the history
  • Loading branch information
desandro committed Jan 22, 2014
1 parent df5c860 commit aaea45a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions outlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -745,10 +745,11 @@ Outlayer.prototype.prepended = function( elems ) {
* @param {Array of Outlayer.Items} items
*/
Outlayer.prototype.reveal = function( items ) {
if ( !items || !items.length ) {
var len = items && items.length;
if ( !len ) {
return;
}
for ( var i=0, len = items.length; i < len; i++ ) {
for ( var i=0; i < len; i++ ) {
var item = items[i];
item.reveal();
}
Expand All @@ -759,10 +760,11 @@ Outlayer.prototype.reveal = function( items ) {
* @param {Array of Outlayer.Items} items
*/
Outlayer.prototype.hide = function( items ) {
if ( !items || !items.length ) {
var len = items && items.length;
if ( !len ) {
return;
}
for ( var i=0, len = items.length; i < len; i++ ) {
for ( var i=0; i < len; i++ ) {
var item = items[i];
item.hide();
}
Expand Down

0 comments on commit aaea45a

Please sign in to comment.