From fca2605a2bc43e4fca57c36e612e1cca991b898f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Ho=CC=88=C3=9Fl?= Date: Sun, 13 Nov 2016 10:52:54 +0100 Subject: [PATCH] Switch back to original view after deleting last change recommendation --- openslides/motions/static/js/motions/motion-services.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openslides/motions/static/js/motions/motion-services.js b/openslides/motions/static/js/motions/motion-services.js index 8ec7b21df..00bab0fa1 100644 --- a/openslides/motions/static/js/motions/motion-services.js +++ b/openslides/motions/static/js/motions/motion-services.js @@ -461,6 +461,13 @@ angular.module('OpenSlidesApp.motions.motionservices', ['OpenSlidesApp.motions', $scope.$watch(function() { return $('.change-recommendation-list').children().length; }, obj.repositionOriginalAnnotations); + $scope.$watch(function () { + return $scope.change_recommendations.length; + }, function () { + if ($scope.change_recommendations.length === 0) { + obj.mode = 'original'; + } + }); var sizeCheckerLastSize = null, sizeCheckerLastClass = null,