Skip to content
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

Merged
merged 4 commits into from
Sep 19, 2016
Merged

Copy Button Added #252

merged 4 commits into from
Sep 19, 2016

Conversation

jcacchio
Copy link
Contributor

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.

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");
Copy link
Owner

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.

Copy link
Contributor Author

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.

@kevinchappell
Copy link
Owner

Excellent and works well. Only thing that needs correcting is the comment I left.

Fixed issue with cloned fields to maintain sortability.
});

var liContents = utils.markup(
'div', [toggleBtn, delBtn], { className: 'field-actions' }
'div', [toggleBtn, copyBtn, delBtn], { className: 'field-actions' }
Copy link
Owner

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

@jcacchio jcacchio Sep 16, 2016

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.

Copy link
Owner

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.

Copy link
Contributor Author

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.
@kevinchappell kevinchappell merged commit d7e8dec into kevinchappell:master Sep 19, 2016
@jcacchio jcacchio deleted the copyButton branch September 20, 2016 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants