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
var Form = require('form'); | |
function PersonalDetails(el, model) { | |
this.el = el; | |
this.model = model; | |
this.form = new Form(el); | |
} |
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
var main = document.querySelector('#main-nav'); | |
parent.addEventListener('click', function(e){ | |
if(e.target.matches('.toggleNav')) { | |
e.preventDefault(); | |
main.classList.toggle('in'); | |
} | |
}); |
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
;(function(){ | |
/** | |
* Require the module at `name`. | |
* | |
* @param {String} name | |
* @return {Object} exports | |
* @api public | |
*/ |
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
function update (data) { | |
var request = new XMLHttpRequest(); | |
request.open('POST', '/whatevers', true); | |
request.send(data); | |
} | |
var View = ripple(template) | |
.use(events); | |
// Might need different change events for each field |
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
.u-enableKerning { | |
text-rendering: optimizeLegibility; | |
font-feature-settings: "kern" 1; | |
font-kerning: normal; | |
} |
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 Component from "tron"; | |
class MyThing extends Component { | |
initialState(){ | |
return { open: false } | |
} | |
mounted(parent, el) { | |
console.log("omg I'm in the dom") | |
} | |
onClick(event) { |
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
{ | |
type: 'element', | |
tagName: 'div', | |
attributes: { class: 'foo' }, | |
children: [{ | |
type: 'element', | |
tagName: 'span', | |
attributes: {}, | |
children: [] | |
}] |
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 styles from './styles.css' | |
export default ({props,state}) => { | |
<div> | |
<style scoped>{styles}</style> | |
<h1>Hello World</h1> | |
</div> | |
} |
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
var deku = require( 'deku' ); | |
// Create a component | |
var HelloWorld = { | |
render: function(c) { | |
return deku.element( 'div', {}, [c.props.text] ); | |
} | |
} | |
// Create a tree |
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 Parent = { | |
render (component, updateState) { | |
function onChange () { | |
updateState({ parentChanged: 'yay' }) | |
} | |
return <Child onChange={onChange} /> | |
} | |
} |
OlderNewer