|
1 | 1 | import { AbstractEditor } from '../editor.js' |
2 | | -import { extend, trigger } from '../utilities.js' |
| 2 | +import { extend, trigger, hasOwnProperty } from '../utilities.js' |
3 | 3 |
|
4 | 4 | export class ObjectEditor extends AbstractEditor { |
5 | 5 | getDefault () { |
@@ -891,19 +891,16 @@ export class ObjectEditor extends AbstractEditor { |
891 | 891 |
|
892 | 892 | addPropertyCheckbox (key) { |
893 | 893 | const self = this |
894 | | - let checkbox |
895 | | - let label |
896 | 894 | let labelText |
897 | | - let control |
898 | 895 |
|
899 | | - checkbox = self.theme.getCheckbox() |
| 896 | + const checkbox = self.theme.getCheckbox() |
900 | 897 | checkbox.style.width = 'auto' |
901 | 898 |
|
902 | 899 | if (this.schema.properties[key] && this.schema.properties[key].title) { labelText = this.schema.properties[key].title } else { labelText = key } |
903 | 900 |
|
904 | | - label = self.theme.getCheckboxLabel(labelText) |
| 901 | + const label = self.theme.getCheckboxLabel(labelText) |
905 | 902 |
|
906 | | - control = self.theme.getFormControl(label, checkbox) |
| 903 | + const control = self.theme.getFormControl(label, checkbox) |
907 | 904 | control.style.paddingBottom = control.style.marginBottom = control.style.paddingTop = control.style.marginTop = 0 |
908 | 905 | control.style.height = 'auto' |
909 | 906 | /* control.style.overflowY = 'hidden'; */ |
@@ -1121,7 +1118,7 @@ export class ObjectEditor extends AbstractEditor { |
1121 | 1118 | this.addproperty_checkboxes[i].disabled = this.addproperty_checkboxes[i].checked |
1122 | 1119 | if (!this.addproperty_checkboxes[i].checked) showModal = true |
1123 | 1120 | } else if (!(i in this.editors)) { |
1124 | | - if (!canAdd && !this.schema.properties.hasOwnProperty(i)) { |
| 1121 | + if (!canAdd && !hasOwnProperty(this.schema.properties, i)) { |
1125 | 1122 | this.addproperty_checkboxes[i].disabled = true |
1126 | 1123 | } else { |
1127 | 1124 | this.addproperty_checkboxes[i].disabled = false |
|
0 commit comments