Yapapaya / jquery-cloneya

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

defaultCount #33

Closed actual-saurabh closed 9 years ago

actual-saurabh commented 9 years ago

@gchokeen With nesting, defaultCount produces weird results, which are logical but may not be expected by the user.

I'm not sure if we need defaultCount because I believe rendering can be done better by the server side scripting or plain copy paste html. I'm in huge favour of removing defaultCount.

Do you have any use case where this parameter is required and makes life easier? Let me know your thoughts.

actual-saurabh commented 9 years ago

Especially since this could easily be done by the following code, if at all necessary:

defaultCount = 5; //for eg.
$clonewrap.cloneya();
$toclone = $( 'some-selector-to-clone' );

for ( var i = 0; i < defaultCount; i++ ){
     $clonewrap.triggerHandler( 'clone.cloneya',  [$toclone] );
}
gchokeen commented 9 years ago

Okay, Let's go for that since it's easy to do from user end. Let's put in wiki.

gchokeen commented 9 years ago

defaultCount option removed since v1.0.0