-
-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
using .innerHTML makes JSON reappear (closes #478) #490
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ define( | |
run: function(conf, doc, cb, msg) { | ||
msg.pub("start", "core/include-config"); | ||
var script = doc.createElement("script"); | ||
script.id = "respecFinalConfig"; | ||
script.id = "initialUserConfig"; | ||
var confFilter = function(key, val) { | ||
// DefinitionMap contains array of DOM elements that aren't serializable | ||
// we replace them by their id | ||
|
@@ -21,7 +21,7 @@ define( | |
} | ||
return val; | ||
} | ||
script.innerText = JSON.stringify(conf, confFilter, 2); | ||
script.innerHTML = JSON.stringify(conf.initialUserConfig, confFilter, 2); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note, innerText doesn't work... it doesn't output when respec calls .innerHTML on the root node. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand why this wouldn't work, but frontend dev is full of mysteries. |
||
script.type = "application/json"; | ||
doc.head.appendChild(script); | ||
msg.pub("end", "core/include-config"); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what the convention us but iirc ReSpec has ws all over the place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
going to fix all that in #493.