| 287 | } |
| 288 | |
| 289 | getGlobalPropertyFromString (strValue) { |
| 290 | if (!strValue.includes('.')) { |
| 291 | if (typeof window[strValue] !== 'undefined') { |
| 292 | return window[strValue] |
| 293 | } |
| 294 | } else { |
| 295 | const arrParts = strValue.split('.') |
| 296 | const obj = arrParts[0] |
| 297 | const prop = arrParts[1] |
| 298 | |
| 299 | if (typeof window[obj] !== 'undefined' && typeof window[obj][prop] !== 'undefined') { |
| 300 | return window[obj][prop] |
| 301 | } |
| 302 | } |
| 303 | /* just a string */ |
| 304 | return strValue |
| 305 | } |
| 306 | |
| 307 | shouldBeUnset () { |
| 308 | return !this.jsoneditor.options.use_default_values && !this.is_dirty |