Skip to content

Instantly share code, notes, and snippets.

@sirwan
Created June 30, 2013 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sirwan/5893474 to your computer and use it in GitHub Desktop.
Save sirwan/5893474 to your computer and use it in GitHub Desktop.
timeago() ... on line 29 and packery on line 27 are not changing the Dom .. after I render my snapshots.hb template.
<script type="text/javascript">
(function($) {
var app = $.sammy('.thumbnails', function(){
this.use('Handlebars', 'hb');
this.get('#/', function(context){
//
});
this.get('#/:username', function(context){
username = context.params.username;
this.load('http://grid.to/api/user/'+username+'/snapshots.json').then(function(snapshots){
$.each(snapshots, function(i, snapshot) {
context.partial('templates/snapshots.hb', {snapshot: snapshot}).appendTo(context.$element());
});
}).then(function(){
this.trigger('applystuff');
});
});
this.bind('applystuff', function(){
var container = $('.thumbnails');
var imgLoad = imagesLoaded( container, function(){
pckry = new Packery(container);
});
$(".timeago").timeago();
});
});
$(function(){
app.run('#/');
});
})(jQuery);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment