File incremental update for new version
This commit is contained in:
@@ -17,6 +17,7 @@ class File
|
||||
this.path.full = this.path.directory + '/' + this.name
|
||||
this.path.parts = this.path.full.split( paths.separator )
|
||||
this.versions = []
|
||||
this.socket = _options.socket
|
||||
|
||||
// Create first version
|
||||
if( typeof _options.content !== 'undefined' )
|
||||
@@ -33,6 +34,9 @@ class File
|
||||
version.content = content
|
||||
version.diff = last_version ? diff.diffChars( last_version.content, version.content ) : false
|
||||
|
||||
// Emit
|
||||
this.socket.emit( 'create_version', { file: this.path.full, version: version } )
|
||||
|
||||
// Save
|
||||
this.versions.push( version )
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user