Last active
July 21, 2016 15:38
-
-
Save krivaten/5fa81acfc0791e99c437e65e1dd2fae9 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'; | |
const { Component, get, computed, String: { loc } } = Ember; | |
const InlineIconComponent = Component.extend({ | |
tagName: 'span', | |
classNames: ['noPrint'], | |
classNameBindings: [ | |
'print::noPrint', | |
'_iconClass' | |
], | |
attributeBindings: [ | |
'hidden:aria-hidden', | |
'_label:aria-label' | |
], | |
icon: computed('attrs.icon', function() { | |
return get(this, 'attrs.icon'); | |
}), | |
print: false, | |
hidden: true, | |
labelLoc: null, | |
_label: computed('labelLoc', function() { | |
let labelLoc = get(this, 'labelLoc'); | |
return labelLoc ? loc(labelLoc) : null; | |
}), | |
_iconClass: computed('name', function() { | |
let icon = get(this, 'icon'); | |
return icon ? `icon-${icon}` : null; | |
}) | |
}); | |
InlineIconComponent.reopenClass({ | |
positionalParams: ['icon'] | |
}); | |
export default InlineIconComponent; |
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({ | |
appName: 'Ember 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
{ | |
"version": "0.10.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": "2.6.0", | |
"ember-data": "2.6.1", | |
"ember-template-compiler": "2.6.0" | |
}, | |
"addons": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment