Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
metallurgical committed Jul 5, 2019
2 parents 931d6c7 + 76b40c0 commit a562c43
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Simple plugin to clone HTML DOM element.

# Current Stable #

- [**V1.4.2**](https://github.com/metallurgical/jquery-metal-clone/archive/v1.4.2.zip "V1.4.2")
- [**V1.4.3**](https://github.com/metallurgical/jquery-metal-clone/archive/v1.4.3.zip "V1.4.3")

# How To Install #

Expand Down
15 changes: 7 additions & 8 deletions jquery.metalClone.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
|-------------------------------------------------------------------
*/

;
(function($) {

$.fn.metalClone = function(options, callback) {
Expand Down Expand Up @@ -53,6 +52,7 @@
nodeType = base[0].nodeName,
// Capture the configuration options
currentCopyValue = opt.copyValue,
currentClearExceptions = opt.clearExceptions,
currentPosition = opt.position,
currentNumberToClone = opt.numberToClone,
currentDestination = opt.destination,
Expand Down Expand Up @@ -374,8 +374,6 @@
clearForm(toClone);
}

clonedElement.push(toClone);

(function (index) {
if (enableScrollTop) {
if (index == 1 && currentIteration == (length - 1)) {
Expand Down Expand Up @@ -409,8 +407,9 @@
clearForm(toClone);
}

clonedElement.push(toClone);
}

clonedElement.push(toClone);
}
}
// not table element and destination not table element
Expand Down Expand Up @@ -588,8 +587,6 @@
clearForm(toClone);
}

clonedElement.push(toClone);

(function (index) {
if (enableScrollTop) {
if (index == 1 && currentIteration == (length - 1)) {
Expand Down Expand Up @@ -622,8 +619,9 @@
clearForm(toClone);
}

clonedElement.push(toClone);
}

clonedElement.push(toClone);
}
}

Expand Down Expand Up @@ -711,7 +709,7 @@
function clearForm(container) {

container.find('input:not("input[type=button], input[type=submit], input[type=checkbox], input[type=radio]"), textarea, select').each(function() {
$(this).val('');
$ (this).not(currentClearExceptions).val('');
});
}

Expand Down Expand Up @@ -1032,6 +1030,7 @@

btnClone: null, // Put your selector(button class or id name) eg : .clickMe | #clickMe
copyValue: false, // Clone together the previous element value - available for form element only
clearExceptions: '', // Make exception for elements that you do not want to clear: eg: '.my_exception_element, #my_exception_element'
btnRemoveText: 'Remove', // Text appear on remove button
btnRemoveClass: null, // Adding user defined class name for remove button
btnCloneText: 'Create New Element', // Text appear on clone button
Expand Down
Loading

0 comments on commit a562c43

Please sign in to comment.