Set default project for new story dialog from header

Although the project detail view does have an Add story button that
does exactly this, it doesn't hurt to set the default project if the
dialog is triggered from the header either, since the Add story
button is not visible if you scroll down enough, which is probably
why this was requested

Story: 2001550
Task: 6491

Change-Id: I8cbbdaba4735780d0101df3170de4280a01c214d
Signed-off-by: Vaishnavi Pamulapati <vaishnavi.p@research.iiit.ac.in>
This commit is contained in:
Vaishnavi Pamulapati 2018-03-29 07:49:33 +05:30
parent 89b60c35ef
commit e0c402d42d
1 changed files with 5 additions and 1 deletions

View File

@ -47,7 +47,11 @@ angular.module('storyboard').controller('HeaderController',
* Create a new story.
*/
$scope.newStory = function () {
NewStoryService.showNewStoryModal()
var projectId = null;
if ($state.current.name === 'sb.project.detail') {
projectId = $state.params.id;
}
NewStoryService.showNewStoryModal(projectId)
.then(function (story) {
// On success, go to the story detail.
$scope.showMobileNewMenu = false;