[extensions-web] Fix up csrfEditable to the code standards
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web] Fix up csrfEditable to the code standards
- Date: Mon, 14 Nov 2011 14:39:52 +0000 (UTC)
commit 828a462d3736733e769f4966a0e3e84f6a0d4db9
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Sun Nov 13 22:58:35 2011 -0500
Fix up csrfEditable to the code standards
sweettooth/static/js/main.js | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/sweettooth/static/js/main.js b/sweettooth/static/js/main.js
index 8917aca..06328b1 100644
--- a/sweettooth/static/js/main.js
+++ b/sweettooth/static/js/main.js
@@ -9,24 +9,24 @@ require(['jquery', 'messages', 'extensions',
$.ajaxSettings.headers['X-CSRFToken'] = $.cookie('csrftoken');
$.fn.csrfEditable = function(url) {
- return this.each(function() {
- var elem = $(this);
+ return $(this).each(function() {
+ var $elem = $(this);
function error(xhr, status, error) {
if (status == 403) {
- elem.css("background-color", "#fcc");
+ $elem.css("background-color", "#fcc");
}
}
- elem.editable(url, { select: true,
- ajaxoptions: { error: error, dataType: 'json' },
- callback: function(result, settings) {
- elem.text(result);
- },
- data: function(string, settings) {
- return $.trim(string);
- }});
- elem.addClass("editable");
+ $elem.editable(url, { select: true,
+ ajaxoptions: { error: error, dataType: 'json' },
+ callback: function(result, settings) {
+ elem.text(result);
+ },
+ data: function(string, settings) {
+ return $.trim(string);
+ }});
+ $elem.addClass("editable");
});
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]