@@ -69,8 +69,6 @@ - (void)viewDidLoad
69
69
}];
70
70
icarousel;
71
71
});
72
- // [self.navigationItem setRightBarButtonItem:[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"addBtn_Nav"] style:UIBarButtonItemStylePlain target:self action:@selector(addItemClicked:)] animated:NO];
73
-
74
72
FRDLivelyButton *rightBtn = [[FRDLivelyButton alloc ] initWithFrame: CGRectMake (0 ,0 ,18.5 ,18.5 )];
75
73
76
74
[rightBtn setOptions: @{ kFRDLivelyButtonLineWidth : @(1 .0f ),
@@ -83,8 +81,13 @@ - (void)viewDidLoad
83
81
}
84
82
85
83
- (void )addItemClicked : (id )sender {
86
- EditTaskViewController *vc = [[EditTaskViewController alloc ] init ];
87
- vc.myTask = [Task taskWithProject: nil andUser: nil ];
84
+ EditTaskViewController *vc = [EditTaskViewController new ];
85
+
86
+ NSInteger curIndex = _myCarousel.currentItemIndex ;
87
+ Project *defaultPro = curIndex > 0 ? _myProjectList[curIndex]: nil ;
88
+ vc.myTask = [Task taskWithProject: defaultPro andUser: defaultPro? [Login curLoginUser ]: nil ];
89
+ vc.myTask .handleType = TaskHandleTypeAddWithoutProject;
90
+
88
91
[self .navigationController pushViewController: vc animated: YES ];
89
92
}
90
93
0 commit comments