-
-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
16 changed files
with
117 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
define([ | ||
"Ember", | ||
"hbs!templates/components/list/ContentListComponent" | ||
], function( | ||
Ember, | ||
layout | ||
) { | ||
|
||
var get = Ember.get; | ||
var set = Ember.set; | ||
var setProperties = Ember.setProperties; | ||
|
||
|
||
return Ember.Component.extend({ | ||
layout: layout, | ||
|
||
tagName: "", | ||
"class": "", | ||
|
||
content : null, | ||
duplicates: null, | ||
|
||
length : 0, | ||
initial: 0, | ||
|
||
|
||
init: function() { | ||
this._super.apply( this, arguments ); | ||
|
||
var length = get( this, "content.length" ); | ||
setProperties( this, { | ||
initial : length, | ||
length : length, | ||
duplicates: {} | ||
}); | ||
}, | ||
|
||
|
||
_contentLengthObserver: function() { | ||
var duplicates = get( this, "duplicates" ); | ||
var content = get( this, "content" ); | ||
var index = get( this, "length" ); | ||
var length = get( content, "length" ); | ||
var diff = -length + index - 1; | ||
|
||
for ( ; index < length; index++ ) { | ||
if ( content.lastIndexOf( content[ index ], diff ) !== -1 ) { | ||
duplicates[ index ] = true; | ||
} | ||
} | ||
|
||
set( this, "length", length ); | ||
}.observes( "content.length" ) | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
define( [ "Ember" ], function( Ember ) { | ||
|
||
return Ember.Helper.helper(function( params ) { | ||
return params[0].hasOwnProperty( params[1] ); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{{#if content.length}} | ||
<ul class="content-list {{class}}"> | ||
{{#each content as |item index|}} | ||
{{yield item (is-gte index initial) (has-own-property duplicates index)}} | ||
{{/each}} | ||
</ul> | ||
{{infinite-scroll targetObject=targetObject}} | ||
{{else if (hasBlock "inverse")}} | ||
<div class="content-empty"> | ||
{{yield to="inverse"}} | ||
</div> | ||
{{/if}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters