Css fixes and improvements

This commit is contained in:
jos 2016-07-12 21:35:43 +02:00
parent 1c3a323387
commit c46f27334c
4 changed files with 16 additions and 8 deletions

View File

@ -3,6 +3,7 @@
overflow: auto; overflow: auto;
height: 100%; height: 100%;
min-height: 150px; min-height: 150px;
padding: 2px 0;
} }
.jsoneditor-node { .jsoneditor-node {
@ -27,19 +28,26 @@ ul.jsoneditor-list {
} }
.jsoneditor-field, .jsoneditor-field,
.jsoneditor-value { .jsoneditor-value,
.jsoneditor-readonly {
min-width: 24px; min-width: 24px;
border: 1px solid transparent;
border-radius: 2px; border-radius: 2px;
word-break: break-word; word-break: break-word;
font-family: droid sans mono, consolas, monospace, courier new, courier, sans-serif;
font-size: 10pt;
color: #1A1A1A;
outline: none;
} }
.jsoneditor-field:focus, .jsoneditor-field:focus,
.jsoneditor-value:focus, .jsoneditor-value:focus {
box-shadow: 0 0 3px 1px #008fd5;
}
.jsoneditor-field:hover, .jsoneditor-field:hover,
.jsoneditor-value:hover { .jsoneditor-value:hover {
background-color: #FFFFAB; background-color: #f5f5f5;
border-color: #ff0;
} }
.jsoneditor-separator { .jsoneditor-separator {

View File

@ -93,7 +93,7 @@ export default class JSONNode extends Component {
renderField (field, parent, onChangeField) { renderField (field, parent, onChangeField) {
const hasParent = parent !== null const hasParent = parent !== null
const content = hasParent ? escapeHTML(field) : 'value' const content = hasParent ? escapeHTML(field) : valueType(this.props.value)
return h('div', { return h('div', {
class: 'jsoneditor-field' + (hasParent ? '' : ' jsoneditor-readonly'), class: 'jsoneditor-field' + (hasParent ? '' : ' jsoneditor-readonly'),

View File

@ -10,7 +10,7 @@ export default function parseJSON(jsonString) {
} }
catch (err) { catch (err) {
// try to throw a more detailed error message using validate // try to throw a more detailed error message using validate
exports.validate(jsonString) validate(jsonString)
// rethrow the original error // rethrow the original error
throw err throw err

View File

@ -23,7 +23,7 @@ export default function valueType(value) {
if (value instanceof RegExp) { if (value instanceof RegExp) {
return 'regexp' return 'regexp'
} }
if (exports.isArray(value)) { if (Array.isArray(value)) {
return 'array' return 'array'
} }