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 BlogComments = {} | |
BlogComments.controller = function (options) { | |
App.state.fetch('blogComments', `/api/blog-post/${ options.blog_id }/comments`) | |
} | |
BlogComments.view = function (ctrl, options) { | |
var comments = App.state.blogComments | |
return m('.blog-comments-component', [ |
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
'use strict'; | |
function grid( axis ){ | |
var items = []; | |
var pending; | |
var container; | |
function queue(){ | |
if( pending ) ( window.cancelAnimationFrame || window.clearTimeout )( pending ); |
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 multi(){ | |
var handlers = Array.prototype.filter.call( arguments, function( x ){ | |
return x instanceof Function | |
} ) | |
return function handle(){ | |
for( var i = 0; i < handlers.length; i++ ) | |
handlers[ i ].apply( this, arguments ) | |
} | |
} |
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
Widget = { | |
controller: function () { | |
this.css = Widget.stylesheet().classes | |
}, | |
view: function (ctrl) { | |
return m('.widget', [ | |
m('h3', { class: ctrl.css.head }), | |
m('div', { class: ctrl.css.body }) | |
]) | |
}, |
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
/* Provides a jQuery 'target' event that fires in all conditions that would | |
* result in an element becoming the target of the URI fragment identifier or | |
* hash as it is often called. It aims to provide a behavioural hook to emulate | |
* CSS3's :target selector [1] (more here [2] and here [3]: good demos include | |
* this proof of concept [4] and Wikipedia's styling of targeted footnotes and | |
* citations [5]). | |
* | |
* [1] https://developer.mozilla.org/en-US/docs/Web/CSS/:target | |
* [2] http://css-tricks.com/on-target/ | |
* [3] http://blog.teamtreehouse.com/stay-on-target |
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( window, undefined ) { | |
'use strict'; | |
// helper function | |
function capitalize( str ) { | |
return str.charAt(0).toUpperCase() + str.slice(1); | |
} | |
// ========================= getStyleProperty by kangax =============================== |
NewerOlder