OSDN Git Service

fix event names
[pettanr/pettanr.git] / app / assets / javascripts / models / panel_picture.js.coffee
index 01a2c5b..eaac8a5 100644 (file)
@@ -35,7 +35,11 @@ class Pettanr.PanelPicture extends Peta.Element
     res\r
   \r
   filename: (picture) ->\r
-    picture.filename() + '?subdir=' + @flip()\r
+    q = if _.isEmpty(@flip())\r
+      ''\r
+    else\r
+      '?subdir=' + @flip()\r
+    picture.filename() + q\r
   \r
   r_url: (picture) ->\r
     '/pictures/' + @filename(picture)\r
@@ -44,7 +48,7 @@ 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
@@ -52,8 +56,7 @@ class Pettanr.PanelPicture extends Peta.Element
   symbol_option: () ->\r
     i = @picture()\r
     i.fetch({cache: true}).done =>\r
-      @symbol_picture = i.tmb_opt_img_tag()\r
-      @trigger('ready:symbol')\r
+      @trigger('ready:symbol', i.tmb_opt_img_tag())\r
   \r
   element_face: () ->\r
     new Pettanr.Views.PanelPicture.ElementFace({element: this})\r
@@ -61,4 +64,7 @@ class Pettanr.PanelPicture extends Peta.Element
   initialize: () ->\r
     if @id\r
       @url = @url + @id\r
+    @bind('change:width', () ->\r
+      console.log('cng')\r
+    )\r
   \r