//clone;
$(".add").click(function(){
$(".clone").first().clone(true).css({"display":"block"}).appendTo($("#editable"))
})
// 拖动排序 设置拖动区域
var editableList = Sortable.create(editable, {
sort:"true",
animation: 150,
handle: '.my-handle', //设置拖动区域 默认是当前列表 但移动端不适合
filter: '.js-remove', //设置删除的按钮
onFilter: function (evt) {
var el = editableList.closest(evt.item); // get dragged item
//console.log(typeof el);
//console.log(evt.item);
//console.log(evt.item.children);
//console.log(evt.item.children[1]);
//console.log(evt.item.children[1].currentSrc);
//console.log(evt.item.children[5].innerHTML);
if(evt.item.children[1].currentSrc != "" || evt.item.children[5].innerHTML != ""){
layer.open({
skin:"demo-class",
content: '确认删除?',
btn: ['确认', '取消'],
shadeClose: false,
yes: function(){
layer.open({content: '确认', time: 1});
el && el.parentNode.removeChild(el);
}, no: function(){
layer.open({content: '您选择了取消', time: 1});
}
})
}
else{
el && el.parentNode.removeChild(el);
}
},
});