Merge pull request #3333 from ulferts/feature/highlight-column-directive

Feature/highlight column directive
pull/3283/merge
Jan Sandbrink 9 years ago
commit f0efafd246
  1. 7
      app/assets/stylesheets/content/_work_packages_table.lsg
  2. 14
      frontend/app/assets/styleguide.jade
  3. 6
      frontend/app/templates/work_packages/work_packages_table.html
  4. 41
      frontend/app/ui_components/highlight-col-directive.js
  5. 3
      frontend/app/ui_components/index.js
  6. 4
      frontend/app/work_packages/directives/work-packages-table-directive.js

@ -6,6 +6,13 @@
<div class="work-packages-table--container">
<div class="work-packages-table--results-container">
<table class="workpackages-table">
<colgroup>
<col highlight-col>
<col highlight-col>
<col highlight-col>
<col highlight-col>
<col highlight-col>
</colgroup>
<thead>
<tr>
<th>

@ -12,6 +12,20 @@ html(id="STYLEGUIDE_HTML_ID")
script.
angular.module('openproject-style-guide', ['ui.select', 'ngSanitize'])
// Add uiComponents to the styleguide.
// In order to be able to do that, we have to mock some
// services that directives in uiComponents rely on.
angular.module('openproject-style-guide')
.service('ActivityService', function() {} )
.service('ConfigurationService', function() {} )
.service('AutoCompleteHelper', function() {} )
.requires.push('openproject.uiComponents');
// get all of angular to be known
script(src='/assets/bundles/openproject-core-app.js')
// avoid errors of undefined jsToolBar
script(src='/assets/jstoolbar/jstoolbar.js')
body.livingstyleguide(ng-app='openproject-style-guide', ng-strict-di=true)
header.livingstyleguide--header

@ -3,10 +3,8 @@
<div class="work-packages-table--results-container" ng-if="rows.length">
<table class="workpackages-table keyboard-accessible-list">
<colgroup>
<col />
<col ng-hide="hideWorkPackageDetails" />
<col />
<col ng-repeat="column in columns" />
<col highlight-col />
<col highlight-col ng-repeat="column in columns" />
</colgroup>
<thead>
<tr>

@ -0,0 +1,41 @@
//-- copyright
// OpenProject is a project management system.
// Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License version 3.
//
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
// Copyright (C) 2006-2013 Jean-Philippe Lang
// Copyright (C) 2010-2013 the ChiliProject Team
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// See doc/COPYRIGHT.rdoc for more details.
//++
module.exports = function() {
return {
link: function(scope, element) {
var thead = element.parent('colgroup').siblings('thead');
thead.on('hover', 'th', function() {
if (element.index() === jQuery(this).index()) {
element.toggleClass('hover');
}
});
}
};
};

@ -109,4 +109,5 @@ angular.module('openproject.uiComponents')
.directive('uploadProgress', [require('./upload-progress-directive')])
.directive('attachmentIcon', [require('./attachment-icon-directive')])
.filter('ancestorsExpanded', require('./filters/ancestors-expanded-filter'))
.filter('latestItems', require('./filters/latest-items-filter'));
.filter('latestItems', require('./filters/latest-items-filter'))
.directive('highlightCol', [require('./highlight-col-directive')]);

@ -151,10 +151,6 @@ module.exports = function(I18n, WorkPackagesTableService, $window, $timeout, fla
angular.element($window).trigger('resize');
});
element.on('hover', 'th', function() {
element.find('col:eq('+ jQuery(this).index() +')').toggleClass('hover');
});
scope.setCheckedStateForAllRows = function(state) {
WorkPackagesTableService.setCheckedStateForAllRows(scope.rows, state);
};

Loading…
Cancel
Save