@@ -38,7 +38,6 @@ class Editor extends React.Component<any, State> {
3838 savedFeedbackTimer : null ,
3939 } ;
4040
41- this . onFileNameBlur = this . onFileNameBlur . bind ( this ) ;
4241 this . onResize = this . onResize . bind ( this ) ;
4342 this . handleCodeChange = this . handleCodeChange . bind ( this ) ;
4443 this . handleFileNameChange = this . handleFileNameChange . bind ( this ) ;
@@ -156,7 +155,7 @@ class Editor extends React.Component<any, State> {
156155 }
157156 fileForm = (
158157 < Form inline = { true } className = "inlineBlock" onSubmit = { this . handleFormSubmit } >
159- < input className = "form-control" type = "text" onBlur = { this . onFileNameBlur }
158+ < input className = "form-control" type = "text"
160159 value = { this . state . fileName } onChange = { this . handleFileNameChange }
161160 style = { style } placeholder = "File name" />
162161 < Button bsSize = "small" bsStyle = "pri-alt" onClick = { this . handleSave } >
@@ -236,22 +235,11 @@ class Editor extends React.Component<any, State> {
236235 }
237236
238237 onResize ( ) {
239- this . setState ( prevState => {
240- return { initialCode : prevState . code } ;
241- } ) ;
242- }
243-
244- onFileNameBlur ( evt : any ) {
245- // save now!
246- /*
247- if (this.state.fileName !== '') {
248- Database.getInstance().then((db: Database) => {
249- return db.saveFile(this.state.fileName, this.state.code);
238+ if ( state . shareHash === undefined ) {
239+ this . setState ( prevState => {
240+ return { initialCode : prevState . code } ;
250241 } ) ;
251- } else {
252- localStorage.setItem('tmpCode', this.state.code);
253242 }
254- */
255243 }
256244}
257245
0 commit comments