diff --git a/src/css/contextmenu.css b/src/css/contextmenu.css index f8f169d..0c8162c 100644 --- a/src/css/contextmenu.css +++ b/src/css/contextmenu.css @@ -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; } diff --git a/src/js/showSortModal.js b/src/js/showSortModal.js index fc825f7..920573a 100644 --- a/src/js/showSortModal.js +++ b/src/js/showSortModal.js @@ -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');