eslint fixes

This commit is contained in:
ido 2015-03-08 16:11:19 +02:00
parent 2a815ab72e
commit e0f3501db7
2 changed files with 4 additions and 3 deletions

View File

@ -154,6 +154,7 @@ define(['react', 'jquery', 'lodash', './playground-fiddle.rt', './playground.rt'
//this.validHTML = this.sampleFunc !== emptyFunc;
this.validHTML = true;
this.sampleRender = generateRenderFunc(this.sampleFunc);
var editor;
try {
this.validProps = true;
//console.log(state.templateProps);
@ -163,7 +164,7 @@ define(['react', 'jquery', 'lodash', './playground-fiddle.rt', './playground.rt'
} catch (e) {
this.validProps = false;
this.sample = null;
var editor = this.refs.editorCode;
editor = this.refs.editorCode;
this.showError(e, editor);
}
//classBase.render = this.sampleRender;
@ -202,11 +203,11 @@ define(['react', 'jquery', 'lodash', './playground-fiddle.rt', './playground.rt'
var editor = this.refs.editorRT;
var name = window.reactTemplates.normalizeName(state.name) + 'RT';
var code = null;
var annot = null;
try {
code = window.reactTemplates.convertTemplateToReact(html.trim().replace(/\r/g, ''), {modules: 'none', name: name});
clearMessage(editor);
} catch (e) {
var annot = null;
if (e.name === 'RTCodeError') {
//index: -1 line: -1 message: "Document should have a root element" name: "RTCodeError"
annot = {line: e.line, message: e.message, index: e.index};

View File

@ -315,7 +315,7 @@ function convertHtmlToReact(node, context) {
data.props = propsTemplateSimple({generatedProps: data.props, rtProps: node.attribs[propsProp]});
} else {
data.props = propsTemplate({generatedProps: data.props, rtProps: node.attribs[propsProp]});
if (!_.contains(context.injectedFunctions,propsMergeFunction)) {
if (!_.contains(context.injectedFunctions, propsMergeFunction)) {
context.injectedFunctions.push(propsMergeFunction);
}
}