Merge pull request #2839 from FinnStutzenstein/Issue2838

Fixing #2838
This commit is contained in:
Emanuel Schütze 2017-01-14 10:40:57 +01:00 committed by GitHub
commit 35a5d4fe3b
2 changed files with 12 additions and 5 deletions

View File

@ -1112,8 +1112,17 @@ angular.module('OpenSlidesApp.motions.site', [
Tag.bindAll({}, $scope, 'tags');
User.bindAll({}, $scope, 'users');
Workflow.bindAll({}, $scope, 'workflows');
MotionChangeRecommendation.bindAll({'where': {'motion_version_id': {'==': motion.active_version}}}, $scope, 'change_recommendations');
Motion.loadRelations(motion, 'agenda_item');
$scope.$watch(function () {
return MotionChangeRecommendation.lastModified();
}, function () {
$scope.change_recommendations = MotionChangeRecommendation.filter({
'where': {'motion_version_id': {'==': motion.active_version}}
});
if ($scope.change_recommendations.length === 0) {
$scope.setProjectionMode($scope.projectionModes[0]);
}
});
$scope.$watch(function () {
return Projector.lastModified();
}, function () {
@ -1154,15 +1163,13 @@ angular.module('OpenSlidesApp.motions.site', [
}
};
$scope.projectionMode = getProjectionMode();
$scope.setProjectionMode = function (mode, event) {
$scope.setProjectionMode = function (mode) {
$scope.projectionMode = mode;
var projectedIds = motion.isProjected();
_.forEach(projectedIds, function (id) {
motion.project(id, mode.mode);
});
event.stopPropagation();
};
$scope.commentsFields = Config.get('motions_comments').value;
$scope.commentFieldForState = MotionComment.getFieldNameForFlag('forState');

View File

@ -30,7 +30,7 @@
<ul class="dropdown-menu" role="menu" aria-labelledby="split-button"
ng-if="projectors.length > 1 || change_recommendations.length">
<li role="menuitem" ng-repeat="mode in projectionModes" ng-if="change_recommendations.length">
<a href="" ng-click="setProjectionMode(mode, $event);">
<a href="" ng-click="setProjectionMode(mode); $event.stopPropagation();">
<i class="fa" ng-class="mode.mode == $parent.projectionMode.mode ? 'fa-check-square-o' : 'fa-square-o'"></i>
<span ng-if="mode.mode!='agreed'">{{ mode.label | translate }}</span>
<span ng-if="mode.mode=='agreed'"><translate translate-context="decision making">Resolution</translate></span