Show work packages table as soon as there are rows and columns

pull/1065/head
Till Breuer 11 years ago
parent de88fc88a9
commit 96951ade62
  1. 7
      app/assets/javascripts/angular/controllers/work-packages-controller.js
  2. 3
      app/assets/javascripts/angular/directives/work_packages/query-form-directive.js
  3. 2
      app/views/work_packages/_list.html.erb

@ -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
*

@ -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();
}
});

@ -31,7 +31,7 @@ See doc/COPYRIGHT.rdoc for more details.
<%= hidden_field_tag 'back_url', url_for(params) %>
<div class="autoscroll">
<work-packages-table ng-if="setupComplete"
<work-packages-table ng-if="rows && columns"
project-identifier="projectIdentifier"
columns="columns"
rows="rows"

Loading…
Cancel
Save