Commits

David Chambers committed 689e55c

CoffeeScript 1.3.2

Comments (0)

Files changed (1)

contenteditable.js

+// Generated by CoffeeScript 1.3.2
 
 jQuery(function($) {
   var $input, elements, indexOf, is_editable, last_saved, nativeIndexOf, save, saved_text, unsaved;
   last_saved = function(el) {
     var idx;
     idx = indexOf(elements, el);
-    if (idx === -1) return;
+    if (idx === -1) {
+      return;
+    }
     return saved_text[idx];
   };
   unsaved = function(el) {
   };
   is_editable = function(fn) {
     return function(event) {
-      if (this.contentEditable === 'true') return fn.call(this, event);
+      if (this.contentEditable === 'true') {
+        return fn.call(this, event);
+      }
     };
   };
   $input = $('<input style=margin:0;width:0;height:0;border:0;padding:0 tabindex=-1>').appendTo(document.body);
   return $('html').delegate('.contenteditable', 'click', function(event) {
     var el, range, selection;
-    if (!$(event.target).hasClass('contenteditable')) return;
+    if (!$(event.target).hasClass('contenteditable')) {
+      return;
+    }
     el = event.target.firstChild;
     el.focus();
     range = document.createRange();
     keydown: is_editable(function(event) {
       var $el;
       $el = $(this);
-      if (unsaved(this)) save(this, $el.text());
+      if (unsaved(this)) {
+        save(this, $el.text());
+      }
       switch (event.keyCode) {
         case 13:
           event.preventDefault();
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.