Browse Source

Bugfix for path in newUntitled.

Ian Rose 8 years ago
parent
commit
75e7c6e07f
1 changed files with 5 additions and 2 deletions
  1. 5 2
      packages/services/src/contents/index.ts

+ 5 - 2
packages/services/src/contents/index.ts

@@ -2,7 +2,7 @@
 // Distributed under the terms of the Modified BSD License.
 
 import {
-  URLExt
+  URLExt, PathExt
 } from '@jupyterlab/coreutils';
 
 import {
@@ -588,7 +588,10 @@ class ContentsManager implements Contents.IManager {
     if (options.path) {
       let [drive, localPath] = this._driveForPath(options.path);
       return drive.newUntitled({ ...options, path: localPath }).then( contentsModel => {
-        return { ...contentsModel, path: options.path } as Contents.IModel;
+        return {
+          ...contentsModel,
+          path: PathExt.join(options.path, contentsModel.name)
+        } as Contents.IModel;
       });
     } else {
       return this._defaultDrive.newUntitled(options);