OSDN Git Service

rewrite loader.js in coffeescript
authorNihad Abbasov <narkoz.2008@gmail.com>
Thu, 6 Sep 2012 11:37:14 +0000 (04:37 -0700)
committerNihad Abbasov <narkoz.2008@gmail.com>
Thu, 6 Sep 2012 11:50:01 +0000 (04:50 -0700)
app/assets/javascripts/loader.js [deleted file]
app/assets/javascripts/loader.js.coffee [new file with mode: 0644]

diff --git a/app/assets/javascripts/loader.js b/app/assets/javascripts/loader.js
deleted file mode 100644 (file)
index 6fa0b52..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-var Loader = { 
-  img_src: "/assets/ajax-loader.gif", 
-
-  html: 
-    function(width) { 
-      img = $("<img>");
-      img.attr("width", width);
-      img.attr("src", this.img_src);
-      return img;
-    }
-}
diff --git a/app/assets/javascripts/loader.js.coffee b/app/assets/javascripts/loader.js.coffee
new file mode 100644 (file)
index 0000000..66f8e8b
--- /dev/null
@@ -0,0 +1,5 @@
+Loader =
+  html: (width) ->
+    $('<img>').attr src: '/assets/ajax-loader.gif', width: width
+
+window.Loader = Loader