Created
February 22, 2018 18:12
-
-
Save snewcomer/3961352055de2ffe9c619ae7dd4478bf to your computer and use it in GitHub Desktop.
Scroll Top after Load
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 images = ["jarjan", "aio___", "kushsolitary", "kolage", "idiot", "gt"]; | |
const models = [...Array(5).fill().map(() => `https://s3.amazonaws.com/uifaces/faces/twitter/${images[(Math.random() * images.length) | 0]}/128.jpg`)]; | |
const otherModels = [...Array(10).fill().map(() => `https://s3.amazonaws.com/uifaces/faces/twitter/${images[(Math.random() * images.length) | 0]}/73.jpg`)]; | |
export default Ember.Controller.extend({ | |
models, | |
init() { | |
this._super(...arguments); | |
Ember.run.scheduleOnce('afterRender', this, () => { | |
Ember.run.later( | |
this, | |
() => { | |
let newModels = Ember.get(this, 'models').unshiftObjects(otherModels); | |
Ember.set(this, 'models', newModels); | |
}, | |
1000 | |
); | |
}); | |
} | |
}); |
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'; | |
export default Ember.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
{ | |
"version": "0.13.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.16.2", | |
"ember-template-compiler": "2.16.2", | |
"ember-testing": "2.16.2" | |
}, | |
"addons": { | |
"ember-data": "2.16.3" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment