Skip to content

Commit

Permalink
Allow custom css for makeResultContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
longouyang committed Dec 31, 2016
1 parent 7fd95df commit 47af37e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion docs/webppl-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -42616,13 +42616,16 @@ var CodeEditor = React.createClass({
}
}
},
makeResultContainer: function () {
makeResultContainer: function (options) {
// TODO: take property arguments so that we can, e.g., make the div inline or have a border or something
this.addResult(_.extend({ type: 'DOM' }));

// return the most recent custom component
// TODO: don't depend on jquery for this
var element = _.last($(ReactDOM.findDOMNode(this)).find('.custom'));
if (options.css) {
$(element).css(options.css);
}
return element;
},
// ------------------------------------------------------------
Expand Down
6 changes: 4 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,15 @@ var CodeEditor = React.createClass({
}
}
},
makeResultContainer: function() {
// TODO: take property arguments so that we can, e.g., make the div inline or have a border or something
makeResultContainer: function(options) {
this.addResult(_.extend({type: 'DOM'}));

// return the most recent custom component
// TODO: don't depend on jquery for this
var element = _.last($(ReactDOM.findDOMNode(this)).find('.custom'));
if (options.css) {
$(element).css(options.css)
}
return element;
},
// ------------------------------------------------------------
Expand Down

0 comments on commit 47af37e

Please sign in to comment.