Skip to content

Instantly share code, notes, and snippets.

View jakobdamjensen's full-sized avatar

Jakob Dam Jensen jakobdamjensen

View GitHub Profile
<template name="hello">
<input type="file" id="file"/>
<ul class="file-list">
{{#each files}}
<li>
{{#if isUploaded}}
<img src="{{url}}"/>
{{/if}}
</li>
if( Meteor.isClient ){
var step = function(e, direction) {
var toStep;
e.shiftKey ? toStep = 10 : toStep = 1;
if(direction === 'down') {
toStep = toStep * -1;
}
@jakobdamjensen
jakobdamjensen / gist:1433795
Created December 5, 2011 14:42
First attempt to do awesome collectionview
Mango.IssuesCollectionView = SC.View.extend({
reuseQueue: [],
backView: null,
content: null,
itemViewClass: SC.View,
topRowIndex: null,
Uncaught RangeError: Maximum call stack size exceeded
(anonymous function)sproutcore-metal/observer:109
invokeEventssproutcore-metal/events:100
sendEventsproutcore-metal/events:181
notifyObserverssproutcore-metal/observer:67
SC.notifyObserverssproutcore-metal/observer:169
SC.propertyDidChangesproutcore-metal/watching:507
SC.View.SC.Object.extend._elementDidChangesproutcore-views/views/view:780
SC.View.SC.Object.extend.forEachChildViewsproutcore-views/views/view:525
SC.View.SC.Object.extend._elementDidChangesproutcore-views/views/view:779
<input class="large" id="xlInput3" name="xlInput3" size="10" type="text" {{bindAttr value="projectName"}}/>
{{#collection Mango.ProjectsGridView contentBinding="Mango.projectsController"}}
{{content.title}}
{{/collection}}
Mango.ProjectsGridView = SC.CollectionView.extend({
itemView: SC.View.extend({
mouseDown: function(evt) {
window.alert('You clicked on ' + this.get('content'));
@jakobdamjensen
jakobdamjensen / gist:1388681
Created November 23, 2011 13:39
Containerview, mixin and controller
-- ContainerView
Mango.MainContentContainerView = SC.ContainerView.extend(Mango.ContainerViewSwapperMixin, {
activeViewBinding: "Mango.mainContentViewController.activeView"
});
--- MIXIN
Mango.ContainerViewSwapperMixin = {