OSDN Git Service

fix escape html
[pettanr/pettanr.git] / app / assets / javascripts / models / panel_picture.js.coffee
index 00ab992..57ecedc 100644 (file)
@@ -44,22 +44,21 @@ class Pettanr.PanelPicture extends Peta.Element
     new Pettanr.Image.SymbolPicture({\r
       attr: {\r
         src: picture.r_url(), \r
-        alt: @get('caption')\r
+        alt: @escape('caption')\r
       },\r
       picture: picture\r
     })\r
   \r
-  symbol_option: (cb) ->\r
+  symbol_option: () ->\r
     i = @picture()\r
-    _this = this\r
-    i.fetch({cache: true}).done ->\r
-      cb(_this.tmb_opt_img_tag(i))\r
+    i.fetch({cache: true}).done =>\r
+      @symbol_picture = i.tmb_opt_img_tag()\r
+      @trigger('ready:symbol')\r
+  \r
+  element_face: () ->\r
+    new Pettanr.Views.PanelPicture.ElementFace({element: this})\r
   \r
   initialize: () ->\r
     if @id\r
       @url = @url + @id\r
   \r
-class Pettanr.PanelPictures extends Backbone.Collection\r
-  model: Pettanr.PanelPicture\r
-  url: '/panel_pictures/'\r
-  \r