Last active
May 12, 2016 00:04
-
-
Save jacobq/f66db68ea7ce53e60ab7d69c41d0b3c2 to your computer and use it in GitHub Desktop.
Card Lists
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.Component.extend({ | |
// FIXME: I don't want to specify the action handlers here | |
// I want to have it bubble up to a higher-level component | |
actions: { | |
dismiss(card) { | |
console.log("OMG dismiss", card); | |
card.set('isHidden', true); | |
} | |
} | |
}); |
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.Component.extend({ | |
}); |
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'; | |
// Couldn't figure out how to import CSS via twiddle.json so rammed it in via CDN here: | |
Ember.$(document).ready(function($) { | |
$('head').append('<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.6/css/materialize.min.css">'); | |
$('body').append('<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.6/js/materialize.min.js"></s' + 'cript>'); | |
$('*[href="#"]').on('click', (event) => { | |
event.preventDefault(); | |
}); | |
}); | |
// Set up sample data for models | |
window.CARD_LIST_DATA = { | |
cards: [{ | |
title: "Card 1", | |
content: "This is the first card." | |
}, { | |
title: "Card 2", | |
content: "Foo bar baz quux" | |
}, { | |
title: "Card 3", | |
content: "Lorem ipsum dolar" | |
}] | |
}; | |
export default Ember.Controller.extend({ | |
appName: 'Card Lists' | |
}); |
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
const EmberApp = require('ember-cli/lib/broccoli/ember-app'); | |
const Funnel = require('broccoli-funnel'); | |
const MergeTrees = require('broccoli-merge-trees'); | |
module.exports = function (defaults) { | |
var app = new EmberApp(defaults, { | |
}); | |
app.import('node_modules/Materialize/dist/css/materialize.min.css'); | |
app.import('node_modules/Materialize/dist/js/materialize.min.js'); | |
const material_icon_fonts = new Funnel( | |
'node_modules/mdi/fonts', {destDir: './assets/fonts'} | |
); | |
const material_icon_css = new Funnel( | |
'node_modules/mdi/css', {destDir: './assets/css'} | |
); | |
return app.toTree([materialize_fonts, google_material_design_icons, material_icon_fonts, material_icon_css]); | |
}; |
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 function evaluate(params/*, hash*/) { | |
return eval(params[0]); | |
} | |
export default Ember.Helper.helper(evaluate); |
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'; | |
import config from './config/environment'; | |
const Router = Ember.Router.extend({ | |
location: 'none' | |
}); | |
Router.map(function() { | |
}); | |
export default Router; |
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.Route.extend({ | |
model() { | |
console.log("index route's model hook"); | |
return window.CARD_LIST_DATA.cards; | |
} | |
}); |
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.8.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"mdi": "^1.5.54", | |
"materialize-css": "^0.97.6", | |
"broccoli-funnel": "^1.0.1", | |
"broccoli-merge-trees": "^1.1.1", | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.5.1", | |
"ember-data": "2.5.2", | |
"ember-template-compiler": "2.5.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment