Skip to content

Instantly share code, notes, and snippets.

@GavinJoyce
Last active April 2, 2016 21:09
Show Gist options
  • Save GavinJoyce/cffe57e33c9fa141ee22831728ad58e2 to your computer and use it in GitHub Desktop.
Save GavinJoyce/cffe57e33c9fa141ee22831728ad58e2 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
didInsertElement: function() {
document.addEventListener("mousemove", (e) => {
this.set('timeStamp', parseInt(e.timeStamp));
});
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
<div style="width: 100%; height: 400px; background-color: cornflowerblue; color: white">
move your mouse here, e.timeStamp is
<pre>[{{timeStamp}}]</pre>
<hr />
In chrome 49, it will be something like <b>3456</b> which is ms since page load. <br />
In firefox 45, it will be something like <b>9362308</b> which is ms since machine start. <br />
In safari 9, it will be something like <b>1459630789270</b> which is ms since 1st Jan 1970.
</div>
{
"version": "0.7.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.3/ember.debug.js",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.4.3/ember-data.js",
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.3/ember-template-compiler.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment