-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy Button Added #252
Copy Button Added #252
Conversation
Included new field action button as well as function for cloning the current field.
|
||
$clone.attr("id", lastID); | ||
$clone.attr("name", cloneName); | ||
$clone.addClass("cloned"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cloned fields with options like select and checkbox groups will need to have their options made sortable again. Adding $('.sortable-options', $clone).sortable();
below this line seems to fix that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Kevin. I did toy with that this morning and pushed that change.
Excellent and works well. Only thing that needs correcting is the comment I left. |
Fixed issue with cloned fields to maintain sortability.
This reverts commit 9618616.
}); | ||
|
||
var liContents = utils.markup( | ||
'div', [toggleBtn, delBtn], { className: 'field-actions' } | ||
'div', [toggleBtn, copyBtn, delBtn], { className: 'field-actions' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we change order of action buttons? I think going from most used to least used from right to left makes sense but that would mean moving the delete button also. What are your thoughts? I ask mainly because I keep cloning fields when i mean to edit them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally don't have a preference. But anyone currently using formBuilder could be thrown off by flip-flopping edit and delete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, I do like having delete in the upper right, since the behavior is similar to "close". I.e. closing a window or a dialog is typically done in the upper right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK so then the question is should it be [toggleBtn, copyBtn, delBtn]
or [copyBtn, toggleBtn, delBtn]
?
I'm fine with it either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, let's leave it at [toggleBtn, copyBtn, delBtn]
keeping the edit button on the left -- closest to the field attributes that need to be edited.
After cloning a field, the options can be re-sorted if desired.
Included new field action button, as well as function for cloning the current field.
For instance, if a form designer wishes to create a survey with multiple "agree/disagree" type questions, they can copy a field and will not have to re-create the field options each time.