OSDN Git Service

try editor event dispatching
[pettanr/pettanr.git] / app / assets / javascripts / models / panel_picture.js.coffee
index 84aa33b..22465d2 100644 (file)
@@ -14,6 +14,9 @@ class Pettanr.PanelPicture extends Peta.Element
   picture: () ->\r
     new Pettanr.Picture({id: @get('picture_id')})\r
   \r
+  panel: (options = {}) ->\r
+    new Pettanr.Panel({id: @get('panel_id')}, options)\r
+  \r
   @has_picture: () ->\r
     true\r
   \r
@@ -46,17 +49,19 @@ class Pettanr.PanelPicture extends Peta.Element
       picture: picture\r
     })\r
   \r
-  symbol_option: (cb) ->\r
+  symbol_option: () ->\r
     i = @picture()\r
-    _this = this\r
-    i.fetch().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
+    @bind('change:width', () ->\r
+      console.log('cng')\r
+    )\r
   \r