|
|
@ -35,18 +35,25 @@ angular.module('openproject.workPackages.tabs') |
|
|
|
require: '^?exclusiveEdit', |
|
|
|
require: '^?exclusiveEdit', |
|
|
|
templateUrl: '/templates/work_packages/tabs/_user_activity.html', |
|
|
|
templateUrl: '/templates/work_packages/tabs/_user_activity.html', |
|
|
|
scope: { |
|
|
|
scope: { |
|
|
|
|
|
|
|
workPackage: '=', |
|
|
|
activity: '=', |
|
|
|
activity: '=', |
|
|
|
activityNo: '=', |
|
|
|
activityNo: '=', |
|
|
|
inputElementId: '=' |
|
|
|
inputElementId: '=' |
|
|
|
}, |
|
|
|
}, |
|
|
|
link: function(scope, element, attrs, exclusiveEditController) { |
|
|
|
link: function(scope, element, attrs, exclusiveEditController) { |
|
|
|
exclusiveEditController.addEditable(scope); |
|
|
|
exclusiveEditController.addEditable(scope); |
|
|
|
|
|
|
|
scope.$watch('inEdit', function(newVal, oldVal) { |
|
|
|
|
|
|
|
if(newVal) { |
|
|
|
|
|
|
|
angular.element('#edit-comment-text').focus(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
scope.I18n = I18n; |
|
|
|
scope.I18n = I18n; |
|
|
|
scope.userPath = PathHelper.staticUserPath; |
|
|
|
scope.userPath = PathHelper.staticUserPath; |
|
|
|
scope.inEdit = false; |
|
|
|
scope.inEdit = false; |
|
|
|
scope.inFocus = false; |
|
|
|
scope.inFocus = false; |
|
|
|
scope.userCanEdit = !!scope.activity.links.update; |
|
|
|
scope.userCanEdit = !!scope.activity.links.update; |
|
|
|
|
|
|
|
scope.userCanQuote = !!scope.workPackage.links.addComment; |
|
|
|
|
|
|
|
|
|
|
|
scope.activity.links.user.fetch().then(function(user) { |
|
|
|
scope.activity.links.user.fetch().then(function(user) { |
|
|
|
scope.userId = user.props.id; |
|
|
|
scope.userId = user.props.id; |
|
|
@ -55,7 +62,6 @@ angular.module('openproject.workPackages.tabs') |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
scope.editComment = function() { |
|
|
|
scope.editComment = function() { |
|
|
|
scope.inEdit = true; |
|
|
|
|
|
|
|
exclusiveEditController.gotEditable(scope); |
|
|
|
exclusiveEditController.gotEditable(scope); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -64,9 +70,10 @@ angular.module('openproject.workPackages.tabs') |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
scope.quoteComment = function() { |
|
|
|
scope.quoteComment = function() { |
|
|
|
|
|
|
|
exclusiveEditController.setQuoted(quotedText(scope.activity.props.rawComment)); |
|
|
|
var elem = angular.element('#' + scope.inputElementId); |
|
|
|
var elem = angular.element('#' + scope.inputElementId); |
|
|
|
elem.val(quotedText(scope.activity.props.rawComment)); |
|
|
|
|
|
|
|
$uiViewScroll(elem); |
|
|
|
$uiViewScroll(elem); |
|
|
|
|
|
|
|
elem.focus(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
scope.updateComment = function(comment) { |
|
|
|
scope.updateComment = function(comment) { |
|
|
|