bunch o things
This commit is contained in:
@@ -26,31 +26,4 @@ $(document).ready(function(){
|
||||
});
|
||||
});
|
||||
|
||||
$('#new').click(function(e) {
|
||||
var v = $(this).text();
|
||||
console.log(v)
|
||||
if(v == "NEW") {
|
||||
var form = $(this).parent("form");
|
||||
form.append('<input name="tag" type="text" id="edit-tag" value="...">');
|
||||
form.append('<textarea name="desc" id="edit-desc">...</textarea>');
|
||||
$(this).text("ADD");
|
||||
} else if (v == "ADD") {
|
||||
if($("#edit-tag").val() === "..." & $("#edit-desc").text() === "...") {
|
||||
$(this).text("NEW");
|
||||
$("#edit-tag").remove()
|
||||
$("#edit-desc").remove()
|
||||
return;
|
||||
}
|
||||
var form = $(this).parent("form");
|
||||
var g = form.serialize() + "&action=new";
|
||||
$.post('/tags', g, function(d) {
|
||||
if(d === 'ok') {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
$(this).text("NEW");
|
||||
$("#edit-tag").remove()
|
||||
$("#edit-desc").remove()
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user