Skip to content

Instantly share code, notes, and snippets.

@emojiijome
Created June 30, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emojiijome/aaa046107b22003787b8 to your computer and use it in GitHub Desktop.
Save emojiijome/aaa046107b22003787b8 to your computer and use it in GitHub Desktop.
/**
* 单击[+]复制当前行
* 单击[-]删除当前行
*/
function copySelf(obj){
var curTrObj = $(obj).parent().parent();
var newTrObj = curTrObj.clone();
if($(obj).html() == "[+]"){
newTrObj.find('a').html('[-]');
curTrObj.after(newTrObj);
}else{
curTrObj.remove();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment