Created
September 2, 2010 11:23
-
-
Save Paxa/562169 to your computer and use it in GitHub Desktop.
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
$('some-link').clk(function(el, event) { | |
Footer.render('my-friends', Profile.id); | |
}); | |
var Present = { | |
id: function(present_id, callback){ | |
if (var present = this.getCached(present_id)) { | |
callback(present); | |
} else { | |
this.fetch(present_id, callback); | |
} | |
} | |
}; | |
Template.register('my-friends', { | |
main: function(friends){ | |
return | |
['#someblock', {bind: [this, 'container']}, this.renderCollection(this.friend, friends) || this.render(this.emptyFriends)]; | |
}, | |
friend: function(friend){ | |
return | |
['.user.small', | |
['%img.userpic.small', {'src': friend.picture.small}], | |
['a', {clk: this.showFriend(friend), store: ['frien_obj', friend]}, friend.full_name] | |
]; | |
}, | |
emptyFriends: function () { | |
return ['a.no_friends', {clk: this.allPeople}, 'Find friends']; | |
}, | |
// this will be wrapped to catch result | |
render: function(friends){ | |
this.renderMain(this.main); | |
// this.result -- will be result node | |
// some logic after rendering | |
}, | |
showFriend: function(friend) { | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment