From b2043fa49dd57bce95d1ce6fb3a15ed3a4ed6ecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Ho=CC=88=C3=9Fl?= Date: Sun, 11 Mar 2018 18:28:16 +0100 Subject: [PATCH] Go to original view after deleting the Title CR, if it is the last one - fixes #3645 --- .../motions/static/js/motions/motion-services.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/openslides/motions/static/js/motions/motion-services.js b/openslides/motions/static/js/motions/motion-services.js index 1beb0baf0..4e5f9558c 100644 --- a/openslides/motions/static/js/motions/motion-services.js +++ b/openslides/motions/static/js/motions/motion-services.js @@ -516,13 +516,18 @@ 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) { + + var checkGotoOriginal = function () { + if ($scope.change_recommendations.length === 0 && $scope.title_change_recommendation === null) { obj.mode = 'original'; } - }); + }; + $scope.$watch(function () { + return $scope.change_recommendations.length; + }, checkGotoOriginal); + $scope.$watch(function () { + return $scope.title_change_recommendation; + }, checkGotoOriginal); var sizeCheckerLastSize = null, sizeCheckerLastClass = null,