Skip to content
This repository was archived by the owner on Jul 29, 2022. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions jquery.jeditable.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
}

self.editing = true;
self.revert = $(self).html();
self.revert = $(self).text();
$(self).html('');

/* Create the form object. */
Expand Down Expand Up @@ -309,7 +309,7 @@
/* Check if given target is function */
if ($.isFunction(settings.target)) {
var str = settings.target.apply(self, [input.val(), settings]);
$(self).html(str);
$(self).text(str);
self.editing = false;
callback.apply(self, [self.innerHTML, settings]);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"self.innerHTML" should be replaced with "str" over here, as well

/* TODO: this is not dry */
Expand Down Expand Up @@ -378,7 +378,7 @@
if (this.editing) {
/* Before reset hook, if it returns false abort reseting. */
if (false !== onreset.apply(form, [settings, self])) {
$(self).html(self.revert);
$(self).text(self.revert);
self.editing = false;
if (!$.trim($(self).html())) {
$(self).html(settings.placeholder);
Expand Down