Last active
October 22, 2015 01:38
-
-
Save ianbale/c9c3e6c5a9908bd2c438 to your computer and use it in GitHub Desktop.
New Twiddle
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
data : [], | |
scrollTimer : null, | |
init : function() | |
{ | |
var data = this.get("data"); | |
for (var x=0;x<1000;x++) | |
{ | |
var obj = {id:x,label:"o".repeat(10) + "_" + x,vis:false}; | |
data.push(obj); | |
obj = null; | |
} | |
Ember.run.later(this,this.make_visible,0,5000); | |
}, | |
make_visible : function(idx) | |
{ | |
var data = this.get("data"); | |
Ember.set(data[idx++],"vis",true); | |
if (idx < data.length) | |
{ | |
Ember.run.later(this,this.make_visible,idx,50); | |
} | |
}, | |
}); |
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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
itemComponent : function() | |
{ | |
var item = this.get("item"); | |
return item.vis ? "item-visible" : "item-hidden"; | |
}.property("item.vis"), | |
}); |
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
{ | |
"version": "0.4.13", | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/1.13.10/ember.debug.js", | |
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/1.13.13/ember-data.js", | |
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/1.13.10/ember-template-compiler.js" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment