OSDN Git Service

fix: fetch fail
[pettanr/pettanr.git] / app / assets / javascripts / view / icon.js.coffee
index ff5334c..9c863df 100644 (file)
@@ -1,7 +1,11 @@
 # image: picture item or image file\r
 class Pettanr.View.Icon extends Tag.Img\r
   \r
-  initialize: (@image, options = {}) ->\r
+  constructor: (@image, options) ->\r
+    super(options)\r
+  \r
+  initialize: (options) ->\r
+    options ||= @image.tag_options()\r
     attr = {}\r
     attr['src'] = @image.src()\r
     size = @get_size()\r
@@ -28,9 +32,11 @@ class Pettanr.View.Icon extends Tag.Img
   \r
 class Pettanr.View.Minicon extends Pettanr.View.Icon\r
   \r
-  initialize: (@image, options = {}) ->\r
-    super(@image, options)\r
-  \r
   get_size: () ->\r
     @image.minicon_size()\r
   \r
+class Pettanr.View.RealIcon extends Pettanr.View.Icon\r
+  \r
+  get_size: () ->\r
+    @image.real_size()\r
+  \r