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

Add support for disabling form action buttons (copy, edit, remove) #550

Merged

Conversation

mikevoets
Copy link
Contributor

@mikevoets mikevoets commented Jul 7, 2017

In my case there is a need for static fields that users are not allowed to remove or edit. Therefore I added support for this by allowing developers to specify which field action buttons they want to disable, in the field values, through a disableFieldButtons array containing one or more of ['copy', 'edit', 'remove'].

Whenever disabling the edit field button, the dblclick event on the field will also be ignored.

In my case there is a need for static fields that users are not allowed to remove or edit. Therefore I added support this by allowing developers to specify in the field values, through a disableFieldButtons array containing one or more of ['copy', 'edit', 'remove'].

Whenever disabling the edit field button, the dblclick event on the field will also be ignored.
})
];

let disabledFieldButtons = values.disabledFieldButtons;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this is coming from values, will generated fields have a disabledFieldButtons attribute?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

@@ -782,6 +782,7 @@ export default class Helpers {
toggleEdit(fieldId, animate = true) {
const field = document.getElementById(fieldId);
const toggleBtn = $('.toggle-form', field);
if (!toggleBtn.length) return;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kevinchappell kevinchappell merged commit f802524 into kevinchappell:master Aug 26, 2017
@mikevoets mikevoets deleted the feature/disable-field-actions branch January 29, 2023 07:28
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