Skip to content

Add new options: #549

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

Merged
merged 1 commit into from
Apr 13, 2016
Merged

Add new options: #549

merged 1 commit into from
Apr 13, 2016

Conversation

MgFrobozz
Copy link

  • disable_array_delete_all_rows: hides the button to delete all rows in an
    array. Note that "disable_array_delete:true" over-rides
    "disable_array_delete_all_rows:false".
  • disable_array_delete_last_row: hides the button to delete the last row in an
    array. Note that "disable_array_delete:true" over-rides
    "disable_array_delete_last_rows:false".
  • disable_add_properties: hides the button to add properties.

* disable_array_delete_all_rows: hides the button to delete all rows in an
  array. Note that "disable_array_delete:true" over-rides
  "disable_array_delete_all_rows:false".
* disable_array_delete_last_row: hides the button to delete the last row in an
  array. Note that "disable_array_delete:true" over-rides
  "disable_array_delete_last_rows:false".
* disable_add_properties: hides the button to add properties.
// If there are minItems items in the array, hide the delete button beneath the rows
if(minItems || this.hide_delete_buttons) {
// If there are minItems items in the array, or configured to hide the delete_last_row button, hide the delete button beneath the rows
if(minItems || this.hide_delete_buttons || this.hide_delete_last_row_buttons) {
Copy link
Owner

Choose a reason for hiding this comment

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

Can't you just check if(minItems || this.hide_delete_last_row_buttons)? Also checking for this.hide_delete_buttons seems redundant.

Copy link
Author

Choose a reason for hiding this comment

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

this.hide_delete_buttons hides all of the delete buttons, so if that flag is set, the programmer doesn't need to set this.hide_delete_last_row_buttons.

If the programmer hast set neither this.hide_delete_buttons nor this.hide_delete_all_rows_buttons, and has set this.hide_delete_last_row_buttons, then it will hide the delete-last-row button, but will display the delete-all-rows button

@jdorn jdorn merged commit b8ca1f3 into jdorn:master Apr 13, 2016
jdorn added a commit that referenced this pull request Apr 13, 2016
Closes #549

Conflicts:
	src/editors/array.js
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