Fixed showing child fields as options when sorting an object

This commit is contained in:
jos 2018-07-11 13:09:01 +02:00
parent 6288139aa7
commit 28215132f7
2 changed files with 36 additions and 1 deletions

View File

@ -353,6 +353,39 @@ div.jsoneditor-contextmenu button.jsoneditor-type-modes > div.jsoneditor-icon {
color: #808080;
}
.jsoneditor-modal .jsoneditor-select-wrapper {
position: relative;
display: inline-block;
}
.jsoneditor-modal .jsoneditor-select-wrapper:after {
content: "";
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 6px solid #666;
position: absolute;
right: 8px;
top: 14px;
pointer-events: none;
}
.jsoneditor-modal select {
padding: 3px 24px 3px 10px;
min-width: 180px;
max-width: 350px;
-webkit-appearance:none;
-moz-appearance:none;
appearance: none;
text-indent: 0;
text-overflow: "";
font-size: 10pt;
line-height: 1.5em;
}
.jsoneditor-modal select::-ms-expand {
display: none;
}

View File

@ -61,7 +61,9 @@ function showSortModal (node, container) {
var field = modal.modalElem().querySelector('#field');
var direction = modal.modalElem().querySelector('#direction');
var paths = node.getChildPaths();
var paths = node.type === 'array'
? node.getChildPaths()
: ['.'];
paths.forEach(function (path) {
var option = document.createElement('option');