OSDN Git Service

fix js
[pettanr/pettanr.git] / app / assets / javascripts / models / system_picture.js.coffee
index 82e60c8..bd5daa6 100644 (file)
@@ -24,11 +24,17 @@ class Pettanr.SystemPicture extends Peta.SystemResource
     {src: @r_url(), width: @get('width'), height: @get('height')}\r
   \r
   tmb_opt_img_tag: () ->\r
-    wh = Pettanr.Imager.thumbnail_size(@get('width'), @get('height'))\r
-    {src: @r_url(), width: wh[0], height: wh[1]}\r
-  \r
-  symbol_option: () ->\r
-    @tmb_opt_img_tag()\r
+    new Pettanr.Image.SymbolPicture({\r
+      attr: {\r
+        src: @r_url()\r
+      },\r
+      picture: this\r
+    })\r
+  \r
+  symbol_option: (cb) ->\r
+    _this = this\r
+    this.fetch().done ->\r
+      cb(_this.tmb_opt_img_tag())\r
   \r
   initialize: () ->\r
     if @id\r