From 96951ade62456c6f81f1985efd9cfdf6b9d475c4 Mon Sep 17 00:00:00 2001 From: Till Breuer Date: Wed, 26 Mar 2014 09:54:56 +0100 Subject: [PATCH] Show work packages table as soon as there are rows and columns --- .../angular/controllers/work-packages-controller.js | 7 +------ .../directives/work_packages/query-form-directive.js | 3 ++- app/views/work_packages/_list.html.erb | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/angular/controllers/work-packages-controller.js b/app/assets/javascripts/angular/controllers/work-packages-controller.js index 1aa4d2b4eb..91ab72905e 100644 --- a/app/assets/javascripts/angular/controllers/work-packages-controller.js +++ b/app/assets/javascripts/angular/controllers/work-packages-controller.js @@ -14,8 +14,7 @@ angular.module('openproject.workPackages.controllers') WorkPackageService.getWorkPackagesByQueryId($scope.projectIdentifier, $scope.query_id) .then($scope.setupWorkPackagesTable) - .then(initAvailableColumns) - .then(setupComplete); + .then(initAvailableColumns); } function initQuery(queryData) { @@ -75,10 +74,6 @@ angular.module('openproject.workPackages.controllers') $scope.loading = false; } - function setupComplete() { - $scope.setupComplete = true; - } - /** * @name withLoading * diff --git a/app/assets/javascripts/angular/directives/work_packages/query-form-directive.js b/app/assets/javascripts/angular/directives/work_packages/query-form-directive.js index bdada28c7c..0541eed8e6 100644 --- a/app/assets/javascripts/angular/directives/work_packages/query-form-directive.js +++ b/app/assets/javascripts/angular/directives/work_packages/query-form-directive.js @@ -11,7 +11,8 @@ angular.module('openproject.workPackages.directives') scope.showQueryOptions = false; scope.$watch('query.group_by', function(oldValue, newValue) { - if (scope.setupComplete && newValue !== oldValue) { + if (newValue !== oldValue && newValue !== undefined) { + // TODO find out why newValue get set to undefined on initial page load scope.updateResults(); } }); diff --git a/app/views/work_packages/_list.html.erb b/app/views/work_packages/_list.html.erb index 947c837764..74804871bf 100644 --- a/app/views/work_packages/_list.html.erb +++ b/app/views/work_packages/_list.html.erb @@ -31,7 +31,7 @@ See doc/COPYRIGHT.rdoc for more details. <%= hidden_field_tag 'back_url', url_for(params) %>
-