OSDN Git Service

add load icon
[pettanr/pettanr.git] / app / assets / javascripts / views / licenses / summary.js.coffee
index 37c8301..09c718a 100644 (file)
@@ -1,17 +1,21 @@
-class Pettanr.Views.License.Summary extends Backbone.View\r
+class Pettanr.Views.License.Summary extends Pettanr.Views.Common.Summary\r
   \r
   initialize: (options) ->\r
     @item = options.item\r
+    @load()\r
   \r
-  render: () ->\r
-    this.$el.html('')\r
+  load: () ->\r
     @system_picture = @item.system_picture()\r
     @system_picture.fetch({cache: true}).done =>\r
-      img = new Tag.Img({\r
+      @img = new Tag.Img({\r
         attr: {\r
           src: @system_picture.r_url()\r
         }\r
       })\r
-      this.$el.html(img.render().el)\r
+      @trigger('ready')\r
+  \r
+  render: () ->\r
+    this.$el.html('')\r
+    this.$el.html(@img.render().el)\r
     this\r
   \r