diff --git a/README.md b/README.md index f1cfaba5d..456d23add 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,11 @@ Here are all the available options: If true, remove all Edit Properties buttons from objects. false + + disable_type_switcher + If true, remove all type switcher from objects. It's recommended to use it with disable_properties option. + false + form_name_root The first part of the `name` attribute of form inputs in the editor. An full example name is `root[person][name]` where "root" is the form_name_root. diff --git a/demo.html b/demo.html index 55c172b72..d84f8b644 100644 --- a/demo.html +++ b/demo.html @@ -94,6 +94,7 @@

Options

+ diff --git a/src/editors/multiple.js b/src/editors/multiple.js index 71279e0a6..9e2d41b5d 100644 --- a/src/editors/multiple.js +++ b/src/editors/multiple.js @@ -171,6 +171,12 @@ JSONEditor.defaults.editors.multiple = JSONEditor.AbstractEditor.extend({ this.container.appendChild(this.header); this.switcher = this.theme.getSwitcher(this.display_text); + + // Disable the type switcher if specified + if(this.jsoneditor.options.disable_type_switcher){ + this.switcher.style.display = "none"; + } + container.appendChild(this.switcher); this.switcher.addEventListener('change',function(e) { e.preventDefault();