OSDN Git Service

fix: fetch fail
[pettanr/pettanr.git] / app / assets / javascripts / view / button.js.coffee
index 8ec6053..b8f8b86 100644 (file)
@@ -1,13 +1,16 @@
 class Pettanr.View.Button extends Tag.A\r
   \r
-  initialize: (@url, @content, options) ->\r
+  constructor: (@url, @content, options) ->\r
+    super(options)\r
+  \r
+  initialize: (options) ->\r
     @context = options.context || this\r
     @class_name = options.class_name\r
     @click_func = options.click\r
-    el = if _.isFunction(content)\r
+    el = if _.isFunction(@content)\r
       content.call(@context)\r
     else\r
-      content\r
+      @content\r
     @url = '/' + @url if @url[0] != '/'\r
     super({\r
       attr: {href: @url}, \r