Skip to content

Commit

Permalink
Ref impl.
Browse files Browse the repository at this point in the history
  • Loading branch information
jzaefferer committed Aug 9, 2010
1 parent 66b43d0 commit 1d550ff
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions jquery.edible-ref.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
(function($) {

$.widget("cgnjs.edible", {
_create: function() {
var self = this;
this.element.bind("click.edible", function(event) {
self.element.hide();
self.input.val($.trim(self.element.text())).show().focus();
});
self.input = $("<input/>")
.insertAfter(self.element)
.hide()
.blur(function() {
$(this).hide();
self.element.show();
})
.keyup(function(event) {
self.element.text(this.value);
});
}
});

})(jQuery);
Empty file added jquery.edible.js
Empty file.

0 comments on commit 1d550ff

Please sign in to comment.