Skip to content

Instantly share code, notes, and snippets.

@tamebadger
Created April 22, 2016 20:34
Show Gist options
  • Save tamebadger/675dc01200589af087769496ca697aa0 to your computer and use it in GitHub Desktop.
Save tamebadger/675dc01200589af087769496ca697aa0 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
click(e){
console.log('clicked')
if(e.shiftKey){
console.log('clicked with shift')
this.sendAction('action')
}
}
});
import Ember from 'ember';
import shiftClick from '../mixins/shift-click'
export default Ember.Component.extend(shiftClick,{
action: 'test'
});
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
}
});
import Ember from 'ember';
export default Ember.Mixin.create({
click(e){
console.log('clicked')
if(e.shiftKey){
console.log('clicked with shift')
this.sendAction('action')
}
}
});
{{#shift-click}}
hey
{{/shift-click}}
{{#test-component}}
hey
{{/test-component}}
{
"version": "0.7.2",
"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.4.4",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.4.3/ember-data.js",
"ember-template-compiler": "2.4.4"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment