EIOS/tpl/js/trudo_portfolio.js

30 lines
1.2 KiB
JavaScript
Raw Normal View History

2023-12-28 15:39:22 +03:00
$(document).ready(function() {
$(".add_item_row").click(function(){
var id=$(this).attr("id");
var newRow = $("#"+id+".item_row").clone().removeClass("item_row").addClass("item_row_clone");
newRow.find(".item_row_action").html("<a href=\"#\" class=\"btn btn-danger del_item_row\" id=\""+id+"\" style=\"margin: -4px 0px 0px 0px;\"><i class=\"icon-remove icon-white\"></i></a>");
$("#"+id+".item_row").after(newRow);
return false;
});
$(document).on("click", ".del_item_row",function(){
var id=$(this).attr("id");
$(this).parent().parent().remove();
return false;
});
$(".add_block_row").click(function(){
var id=$(this).attr("id");
var newRow = $("#"+id+".block_row").clone().removeClass("block_row").addClass("block_row_clone");
newRow.find(".block_row_action").html("<a href=\"#\" class=\"btn btn-danger del_block_row\" id=\""+id+"\" style=\"margin: -4px 0px 0px 0px;\"><i class=\"icon-remove icon-white\"></i></a>");
$("#"+id+".block_row").after(newRow);
return false;
});
$(document).on("click", ".del_block_row",function(){
var id=$(this).attr("id");
$(this).parent().parent().parent().parent().parent().parent().parent().remove();
return false;
});
});