Fixed #58: css not being loaded in case of AMD and multiple scripts

This commit is contained in:
josdejong 2013-07-30 22:13:26 +02:00
parent 38a356a5c3
commit 02c5fa416b
6 changed files with 13 additions and 9 deletions

View File

@ -6,6 +6,7 @@ http://jsoneditoronline.org
## version 2.2.2
- Fixed non working option `indentation`.
- Fixed css not being loaded with AMD in case of multiple scripts.
## 2013-05-27, version 2.2.1

View File

@ -11,7 +11,7 @@
"http://jsoneditoronline.org/NOTICE"
],
"launch": {
"web_url": "http://jsoneditoronline.org/"
"web_url": "http://jsoneditoronline.org/index.html?referrer=chrome_app"
}
},
"icons": {

6
jsoneditor-min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -28,7 +28,7 @@
*
* @author Jos de Jong, <wjosdejong@gmail.com>
* @version 2.3.0-SNAPSHOT
* @date 2013-05-28
* @date 2013-07-30
*/
(function () {
@ -1054,6 +1054,9 @@ TextEditor.prototype._create = function (container, options, json) {
if (options.indentation) {
this.indentation = Number(options.indentation);
}
else {
this.indentation = 4; // number of spaces
}
this.mode = (options.mode == 'code') ? 'code' : 'text';
if (this.mode == 'code') {
// verify whether Ace editor is available and supported
@ -1073,7 +1076,6 @@ TextEditor.prototype._create = function (container, options, json) {
this.container = container;
this.editor = undefined; // ace code editor
this.textarea = undefined; // plain text editor (fallback when Ace is not available)
this.indentation = 4; // number of spaces
this.width = container.clientWidth;
this.height = container.clientHeight;
@ -2308,7 +2310,7 @@ Node.prototype._updateDomValue = function () {
color = 'red';
}
else if (t == 'boolean') {
color = 'orange';
color = 'darkorange';
}
else if (this._hasChilds()) {
// note: typeof(null)=="object", therefore check this.type instead of t
@ -2984,6 +2986,7 @@ Node.prototype._createDomTree = function () {
var domTree = document.createElement('table');
var tbody = document.createElement('tbody');
domTree.style.borderCollapse = 'collapse'; // TODO: put in css
domTree.className = 'values';
domTree.appendChild(tbody);
var tr = document.createElement('tr');
tbody.appendChild(tr);
@ -6054,8 +6057,8 @@ if (typeof(module) != 'undefined' && typeof(exports) != 'undefined') {
* AMD module exports
*/
if (typeof(require) != 'undefined' && typeof(define) != 'undefined') {
loadCss();
define(function () {
loadCss();
return jsoneditor;
});
}

View File

@ -39,8 +39,8 @@ if (typeof(module) != 'undefined' && typeof(exports) != 'undefined') {
* AMD module exports
*/
if (typeof(require) != 'undefined' && typeof(define) != 'undefined') {
loadCss();
define(function () {
loadCss();
return jsoneditor;
});
}