Skip to content

Instantly share code, notes, and snippets.

View Panman82's full-sized avatar

Ryan Panning Panman82

View GitHub Profile
@Panman82
Panman82 / components.card-list.js
Last active May 12, 2016 21:07
Cards List w/ Dynamic Buttons
import Ember from 'ember';
export default Ember.Component.extend({
});
@Panman82
Panman82 / components.card-list.js
Created May 12, 2016 20:41
Card List w/ Component Yield
import Ember from 'ember';
export default Ember.Component.extend({
});
@Panman82
Panman82 / components.card-list.js
Last active May 12, 2016 20:35
Cards List w/ One Component
import Ember from 'ember';
export default Ember.Component.extend({
});
@Panman82
Panman82 / controllers.application.js
Last active May 12, 2016 19:58
Cards List w/ Dismiss Action
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
removeCard( card ) {
let cards = this.get('model');
cards.removeObject( card );
}
}
});
@Panman82
Panman82 / application.controller.js
Last active February 17, 2016 16:11
.set()ing on init() hook overrides attrs
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
@Panman82
Panman82 / application.controller.js
Created February 10, 2016 20:40
.set()ing bound prop triggers didReceiveAttrs()
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
@Panman82
Panman82 / application.controller.js
Last active February 10, 2016 16:57
didReceiveAttrs() hook missed
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
init() {
this._super( ...arguments );
this.set('controllerHash', Ember.Object.create({
foo: 'Foo'
}));
@Panman82
Panman82 / application.controller.js
Created February 9, 2016 15:09
Delayed QP Update
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
queryParams: ['search'],
search: '',
searchText: Ember.computed.reads('search'),
copySearch() {
@Panman82
Panman82 / froala-semantic-icons.js
Last active July 20, 2017 08:24
This is an ember-cli / ember initializer that changes the Froala Editor icons from the Font Awesome names to the Semantic UI names (technically Font Awesome just re-named). For those using Froala Editor with Semantic UI outside of the ember ecosystem, just use lines 5 to 57 and remove `Ember.` prefixes.
// app/initializers/froala-semantic-icons.js
import Ember from 'ember';
export function initialize() {
// https://www.froala.com/wysiwyg-editor/docs/concepts/custom-icon
Ember.$.FroalaEditor.ICON_DEFAULT_TEMPLATE = 'semantic_ui';
Ember.$.FroalaEditor.DefineIconTemplate( 'semantic_ui', '<i class="[NAME] icon"></i>');
Ember.$.FroalaEditor.DefineIcon('color' , {NAME:'theme' }); // tint
Ember.$.FroalaEditor.DefineIcon('undo' , {NAME:'undo' }); // rotate-left
Ember.$.FroalaEditor.DefineIcon('redo' , {NAME:'repeat' }); // rotate-right
@Panman82
Panman82 / ember-active-route-initializer.js
Last active January 14, 2016 22:09
Adds an `activeRoutes` array to the Ember `Router`, along with a `routeFor` lookup method/helper
// app/initializers/router-active-routes.js
import Ember from 'ember';
export function initialize() {
Ember.Route.reopen({
// Helper function for Routes to lookup other routes,