Created
June 30, 2013 01:59
-
-
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.
This file contains hidden or 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
<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