{\r
// Delete cookie and reset settings\r
del_cookie("logginNitdoc");\r
+ closeAllCommentInEdtiting();\r
} \r
displayLogginModal();\r
});\r
\r
// Disable the edit mode\r
$('a[id=cancelBtn]').click(function(){\r
- if(editComment > 0){ editComment -= 1; }\r
- // Hide itself\r
- $(this).hide();\r
- // Hide commitBtn\r
- $(this).next().hide();\r
- // Hide Textarea\r
- $(this).prev().hide();\r
- // Show comment\r
- $(this).prev().prev().show();\r
- });\r
+ closeEditing($(this));\r
+ });\r
\r
// Display commit form\r
$('a[id=commitBtn]').click(function(){\r
}\r
});\r
$.when(updateCookie(userName, password, repoName, branchName)).done(function(){\r
+ closeAllCommentInEdtiting();\r
reloadComment();\r
});\r
});\r
// Delete all option in the list\r
function cleanListBranches(){\r
$('#dropBranches').children("option").remove();\r
-}
+}\r
+\r
+function closeAllCommentInEdtiting(){\r
+ $('a[id=cancelBtn]').each(function(){\r
+ closeEditing($(this));\r
+ });\r
+}\r
+\r
+function closeEditing(tag){\r
+ if(editComment > 0){ editComment -= 1; }\r
+ // Hide itself\r
+ tag.hide();\r
+ // Hide commitBtn\r
+ tag.next().hide();\r
+ // Hide Textarea\r
+ tag.prev().hide();\r
+ // Show comment\r
+ tag.prev().prev().show();\r
+}\r