Yapapaya / jquery-cloneya

A jquery plugin to clone DOM elements
MIT License
76 stars 28 forks source link

How to prevent clone with before_clone? #72

Open seglavi opened 5 years ago

seglavi commented 5 years ago

Hi,

I have a question. How to prevent clone with before_clone?

.on('before_clone.cloneya', function (e, toclone) {
    if(!toclone.find(".input .title").val() || !toclone.find(".input .name").val()) {
        return false;
    }
})

I have a plan like this. before_clone if the values are empty i don't want to clone. I want to abort the event. But i can't success. Any one have any idea?

Thanks.