Create expand/collapse all buttons
This commit is contained in:
parent
61d91c2f9c
commit
637aa62762
|
@ -45,6 +45,10 @@
|
|||
<button id="patchJson">patch json</button>
|
||||
<input id="loadFile" type="file">
|
||||
</p>
|
||||
<p>
|
||||
<button id="expandAll">expand all</button>
|
||||
<button id="collapseAll">collapse all</button>
|
||||
</p>
|
||||
|
||||
<script type="module">
|
||||
import jsoneditor from './dist/es/jsoneditor.js'
|
||||
|
@ -153,6 +157,14 @@
|
|||
}
|
||||
reader.readAsText(file)
|
||||
}
|
||||
|
||||
document.getElementById('expandAll').onclick = function expandAll () {
|
||||
testEditor.expandAll()
|
||||
}
|
||||
|
||||
document.getElementById('collapseAll').onclick = function collapseAll () {
|
||||
testEditor.collapseAll()
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue