-
-
Save sbatson5/5f72c59451e156aaa7e7 to your computer and use it in GitHub Desktop.
New Twiddle
This file contains hidden or 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'; | |
const { Controller, on, get } = Ember; | |
export default Controller.extend({ | |
data: [], | |
start: on('init', function() { | |
const data = get(this, "data"); | |
for (let x=0;x<1000;x++) | |
{ | |
const obj = {id:x,label:"o".repeat(10) + "_" + x,vis:false}; | |
data.pushObject(obj); | |
} | |
//Ember.run.later(this,this.make_visible,0,5000); | |
}) | |
}); |
This file contains hidden or 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'; | |
const { | |
Route, | |
set | |
} = Ember; | |
export default Route.extend({ | |
}); |
This file contains hidden or 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'; | |
const { | |
Component, | |
computed, | |
get, | |
on, | |
run | |
} = Ember; | |
export default Component.extend({ | |
itemComponent: computed('item.vis', { | |
get() { | |
return get(this, 'item.vis') ? "item-visible" : "item-hidden"; | |
} | |
}), | |
start: on('didInsertElement', function() { | |
run.later(this,this.make_visible,0,5000); | |
}), | |
make_visible(idx) | |
{ | |
const data = get(this, "data"); | |
Ember.set(data[idx++],"vis",true); | |
if (idx < data.length) | |
{ | |
Ember.run.later(this,this.make_visible,idx,50); | |
} | |
} | |
}); |
This file contains hidden or 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