diff --git a/ajax/documentController.php b/ajax/documentController.php index f6cc2b66..ea425270 100644 --- a/ajax/documentController.php +++ b/ajax/documentController.php @@ -33,6 +33,8 @@ class DocumentController extends Controller{ } $view->file_put_contents($path, $content); + $info = $view->getFileInfo($path); + \OCP\JSON::success(array ('fileid' => $info['fileid']) ); } diff --git a/js/documents.js b/js/documents.js index 93b71532..6461dba1 100644 --- a/js/documents.js +++ b/js/documents.js @@ -287,7 +287,15 @@ var documentsMain = { $.post( OC.generateUrl('apps/documents/ajax/documents/create'), {}, - documentsMain.show + function(response){ + if (response && response.fileid){ + documentsMain.prepareSession(); + documentsMain.joinSession(response.fileid); + } else { + documentsMain.show(); + } + } + ); },