Skip to content

Commit 4cfd60c

Browse files
committed
Merge branch 'master' into master
2 parents a450a3b + 702e1b8 commit 4cfd60c

File tree

20 files changed

+189
-67
lines changed

20 files changed

+189
-67
lines changed

CONTRIBUTING.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ project's developers might not want to merge into the project.
9292
Please adhere to the coding conventions used throughout a project (indentation,
9393
accurate comments, etc.) and any other requirements (such as test coverage).
9494

95+
**Include Examples** If possible, include links to a youtube video or GIF
96+
demonstrating your fix or your feature. It will help us understand what you
97+
are doing and why we want to merge it in.
98+
9599
Adhering to the following this process is the best way to get your work
96100
included in the project:
97101

@@ -133,13 +137,18 @@ included in the project:
133137
git pull [--rebase] upstream master
134138
```
135139

136-
6. Push your topic branch up to your fork:
140+
6. Squash your change into one commit
141+
```bash
142+
git rebase -i master
143+
```
144+
145+
7. Push your topic branch up to your fork:
137146

138147
```bash
139-
git push origin <topic-branch-name>
148+
git push [--force] origin <topic-branch-name>
140149
```
141150

142-
7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
151+
8. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
143152
with a clear title and description.
144153

145154
**IMPORTANT**: By submitting a patch, you agree to allow the project owners to

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
[![Build Status](https://api.travis-ci.org/angular-ui/ui-grid.png?branch=3.0)](https://travis-ci.org/angular-ui/ui-grid) [![Coverage Status](https://coveralls.io/repos/angular-ui/ui-grid/badge.png?branch=master)](https://coveralls.io/r/angular-ui/ui-grid?branch=master)
44
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/angular-ui/ui-grid?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
5+
[![npm](https://img.shields.io/npm/dm/angular-ui-grid.svg)](https://www.npmjs.com/package/angular-ui-grid)
6+
[![npm](https://img.shields.io/npm/dt/angular-ui-grid.svg)](https://www.npmjs.com/package/angular-ui-grid)
57

68
[![Selenium Test Status](https://saucelabs.com/browser-matrix/nggrid.svg)](https://saucelabs.com/u/nggrid)
79

@@ -163,7 +165,7 @@ With the 3.0 release, the repository has been renamed from "ng-grid" to "ui-grid
163165
164166
All network traffic to GitHub should redirect automatically but they say you should update your git remote url:
165167
166-
git remote set-url origin https://github.com/angular-ui/ui-grid.git
168+
git remote set-url origin https://github.com/angular-ui/ui-grid.git
167169
168170
# Thanks
169171

misc/tutorial/205_row_editable.ngdoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The basic method of operation is that whenever a cell is edited (identified usin
3131
event) an `isDirty` flag is set on the row, and a `saveTimer` is set. If another cell in the same row commences
3232
editing within 2 seconds (or other configurable time), then the timer will be destroyed again. Otherwise
3333
upon the timer completing the row will be set to a status of `isSaving` and greyed out, and the `saveRow`
34-
event will be called. The function called by this event must return a promise, and the rowedit feature
34+
event will be called. The function called by this event must call `rowEdit.setSavePromise`, and the rowedit feature
3535
will wait on that promise.
3636

3737
If the cellNav feature is also enabled, then a setFocus on a cell within the row is sufficient to delay

src/features/cellnav/js/cellnav.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -681,8 +681,10 @@
681681
if (grid.cellNav.lastRowCol === null || rowColSelectIndex === -1) {
682682
var newRowCol = new GridRowColumn(row, col);
683683

684-
grid.api.cellNav.raise.navigate(newRowCol, grid.cellNav.lastRowCol);
685-
grid.cellNav.lastRowCol = newRowCol;
684+
if (grid.cellNav.lastRowCol === null || grid.cellNav.lastRowCol.row !== newRowCol.row || grid.cellNav.lastRowCol.col !== newRowCol.col){
685+
grid.api.cellNav.raise.navigate(newRowCol, grid.cellNav.lastRowCol);
686+
grid.cellNav.lastRowCol = newRowCol;
687+
}
686688
if (uiGridCtrl.grid.options.modifierKeysToMultiSelectCells && modifierDown) {
687689
grid.cellNav.focusedCells.push(rowCol);
688690
} else {

src/features/exporter/js/exporter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
* <div class="alert alert-success" role="alert"><strong>Stable</strong> This feature is stable. There should no longer be breaking api changes without a deprecation warning.</div>
1515
*
16-
* This module provides the ability to exporter data from the grid.
16+
* This module provides the ability to export data from the grid.
1717
*
1818
* Data can be exported in a range of formats, and all data, visible
1919
* data, or selected rows can be exported, with all columns or visible

src/features/move-columns/js/column-movable.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@
168168
});
169169
},
170170
redrawColumnAtPosition: function (grid, originalPosition, newPosition) {
171+
if (originalPosition === newPosition) {
172+
return;
173+
}
171174

172175
var columns = grid.columns;
173176

@@ -436,16 +439,7 @@
436439
//Left of cloned element should be aligned to original header cell.
437440
movingElm.addClass('movingColumn');
438441
var movingElementStyles = {};
439-
var elmLeft;
440-
if (gridUtil.detectBrowser() === 'safari') {
441-
//Correction for Safari getBoundingClientRect,
442-
//which does not correctly compute when there is an horizontal scroll
443-
elmLeft = $elm[0].offsetLeft + $elm[0].offsetWidth - $elm[0].getBoundingClientRect().width;
444-
}
445-
else {
446-
elmLeft = $elm[0].getBoundingClientRect().left;
447-
}
448-
movingElementStyles.left = (elmLeft - gridLeft) + 'px';
442+
movingElementStyles.left = $elm[0].offsetLeft + 'px';
449443
var gridRight = $scope.grid.element[0].getBoundingClientRect().right;
450444
var elmRight = $elm[0].getBoundingClientRect().right;
451445
if (elmRight > gridRight) {
@@ -475,7 +469,8 @@
475469

476470
//Update css of moving column to adjust to new left value or fire scroll in case column has reached edge of grid
477471
if ((currentElmLeft >= gridLeft || changeValue > 0) && (currentElmRight <= rightMoveLimit || changeValue < 0)) {
478-
movingElm.css({visibility: 'visible', 'left': newElementLeft + 'px'});
472+
movingElm.css({visibility: 'visible', 'left': (movingElm[0].offsetLeft +
473+
(newElementLeft < rightMoveLimit ? changeValue : (rightMoveLimit - currentElmLeft))) + 'px'});
479474
}
480475
else if (totalColumnWidth > Math.ceil(uiGridCtrl.grid.gridWidth)) {
481476
changeValue *= 8;

src/features/tree-base/js/tree-base.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@
237237
* all transient information on the tree (children, childCount) and recalculate it
238238
*
239239
*/
240-
grid.treeBase.tree = {};
240+
grid.treeBase.tree = [];
241241

242242
service.defaultGridOptions(grid.options);
243243

src/features/tree-view/less/tree-view.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33
.ui-grid-tree-header-row {
44
font-weight: bold !important;
55
}
6+
.ui-grid-tree-header-row .ui-grid-cell.ui-grid-disable-selection.ui-grid-row-header-cell {
7+
pointer-events: all;
8+
}

src/js/core/directives/ui-grid-header-cell.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,10 @@
223223
}
224224
contents.addClass(classAdded);
225225

226-
var rightMostContainer = $scope.grid.renderContainers['right'] ? $scope.grid.renderContainers['right'] : $scope.grid.renderContainers['body'];
227-
$scope.isLastCol = ( $scope.col === rightMostContainer.visibleColumnCache[ rightMostContainer.visibleColumnCache.length - 1 ] );
226+
$timeout(function (){
227+
var rightMostContainer = $scope.grid.renderContainers['right'] ? $scope.grid.renderContainers['right'] : $scope.grid.renderContainers['body'];
228+
$scope.isLastCol = ( $scope.col === rightMostContainer.visibleColumnCache[ rightMostContainer.visibleColumnCache.length - 1 ] );
229+
});
228230

229231
// Figure out whether this column is sortable or not
230232
if (uiGridCtrl.grid.options.enableSorting && $scope.col.enableSorting) {

src/js/core/directives/ui-grid-menu.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,20 @@ function ($compile, $timeout, $window, $document, gridUtil, uiGridConstants, i18
4545
link: function ($scope, $elm, $attrs, uiGridCtrl) {
4646
var menuMid;
4747
var $animate;
48+
var gridMenuMaxHeight;
49+
50+
$scope.dynamicStyles = '';
51+
52+
if (uiGridCtrl) {
53+
// magic number of 30 because the grid menu displays somewhat below
54+
// the top of the grid. It is approximately 30px.
55+
gridMenuMaxHeight = uiGridCtrl.grid.gridHeight - 30;
56+
$scope.dynamicStyles = [
57+
'.grid' + uiGridCtrl.grid.id + ' .ui-grid-menu-mid {',
58+
'max-height: ' + gridMenuMaxHeight + 'px;',
59+
'}'
60+
].join(' ');
61+
}
4862

4963
$scope.i18n = {
5064
close: i18nService.getSafeText('columnMenu.close')

0 commit comments

Comments
 (0)