From 1bf1ca39a2f6a484e5ce73e2da5b8817187c3e66 Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Tue, 7 Aug 2012 21:28:49 +0000 Subject: [PATCH] Disable the possibilty to edit tag 2 times --- js/bookmarks.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/js/bookmarks.js b/js/bookmarks.js index 21c1a2d7..606d2cb2 100644 --- a/js/bookmarks.js +++ b/js/bookmarks.js @@ -325,11 +325,12 @@ function hasProtocol(url) { } function renameTag(event) { - tag_el = $(this).closest('li'); - tag_el.append(''); - - tag_name = tag_el.find('.tag').hide().text(); - tag_el.find('input').val(tag_name).bind('blur',submitTagName); + if($('input[name="tag_new_name"]').length) return; // Do nothing if a tag is currenlty edited + tag_el = $(this).closest('li'); + tag_el.append(''); + tag_el.find('.tag_edit').hide(); + tag_name = tag_el.find('.tag').hide().text(); + tag_el.find('input').val(tag_name).bind('blur',submitTagName); } @@ -337,6 +338,7 @@ function submitTagName(event) { tag_el = $(this).closest('li') new_tag_name = tag_el.find('input').val(); old_tag_name = tag_el.find('.tag').show().text(); + tag_el.find('.tag_edit').show(); tag_el.find('input').remove(); //submit