diff --git a/app/assets/javascripts/photos.js b/app/assets/javascripts/photos.js index e80b720..220f9a8 100644 --- a/app/assets/javascripts/photos.js +++ b/app/assets/javascripts/photos.js @@ -66,59 +66,43 @@ function onLoadData(data) { var html = '' , i = 0 , length = data.photos.length - , image; - - for(; i' + , image + , tmpl = '<% _.each(data, function(image) { %> ' + + '
  • ' + '
    ' - + '' + + '' + '
    ' + '
    ' + '
    ' - + '

    <%= name %>

    ' + + '

    <%= image.name %>

    ' + '
    ' - + '' - + '

    <%= pref %>

    ' + + '' + + '

    <%= image.prefecture %>

    ' + '
    ' + '' - + '
  • ' - ); - - // Add image HTML to the page. - $('#tiles').append( - tmpl({ - 'id' : image.id - , 'filename': image.avatar_file_name - , 'name' : image.name - , 'pref' : image.prefecture - , 'like' : image.like - , 'look' : image.look - })); - } + + '<% }); %>'; - // Apply layout. - applyLayout(); + // Add image HTML to the page. + $('#tiles').append(_.template(tmpl, {data: data.photos})); - /* $("span").on("click",function(){ + // Apply layout. + applyLayout(); - });*/ + /* $("span").on("click",function(){ - }; + });*/ +}; $(document).ready(new function() {