From b976f9b3665771444c30e914fe21cbce5848bd21 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 18 Oct 2009 10:30:36 -0700 Subject: Move away from embedding the tag id in to the CSS id. This is brittle and causes us to do silly things to extract the id. Use rel instead so: becomes: --- modules/tag/js/tag.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/tag/js') diff --git a/modules/tag/js/tag.js b/modules/tag/js/tag.js index 17845272..532ada95 100644 --- a/modules/tag/js/tag.js +++ b/modules/tag/js/tag.js @@ -37,7 +37,7 @@ function editInPlace(element) { closeEditInPlaceForms(); // create edit form - var tag_id = $(this).attr('id').substr(5); + var tag_id = $(this).attr('rel'); var tag_name = $(this).html(); var tag_width = $(this).width(); $(this).parent().data("revert", $(this).parent().html()); @@ -64,7 +64,7 @@ function editInPlace(element) { success: function(data) { if (data.result == "success") { closeEditInPlaceForms(); // close form - $("#g-tag-" + data.tag_id).text(data.new_tagname); // update tagname + $(".g-tag[rel=" + data.tag_id + "]").text(data.new_tagname); // update tagname console.log(data); window.location.reload(); } else if (data.result == "error") { -- cgit v1.2.3