Skip to content

Commit d36f923

Browse files
NilannoNilanno
authored andcommitted
Merge branch 'master' into master
2 parents 4e2f43c + 702e1b8 commit d36f923

File tree

10 files changed

+25
-21
lines changed

10 files changed

+25
-21
lines changed

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
.ui-grid-tree-header-row {
44
font-weight: bold !important;
55
}
6-
.ui-grid-tree-header-row .ui-grid-row-header-cell.ui-grid-disable-selection.ui-grid-cell {
6+
.ui-grid-tree-header-row .ui-grid-cell.ui-grid-disable-selection.ui-grid-row-header-cell {
77
pointer-events: all;
88
}

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@
7878
}
7979
}
8080

81+
var mostRecentData;
82+
8183
function dataWatchFunction(newData) {
8284
// gridUtil.logDebug('dataWatch fired');
8385
var promises = [];
@@ -90,6 +92,8 @@
9092
}
9193
}
9294

95+
mostRecentData = newData;
96+
9397
if (newData) {
9498
// columns length is greater than the number of row header columns, which don't count because they're created automatically
9599
var hasColumns = self.grid.columns.length > (self.grid.rowHeaderColumns ? self.grid.rowHeaderColumns.length : 0);
@@ -118,7 +122,8 @@
118122
}
119123

120124
$q.all(promises).then(function() {
121-
self.grid.modifyRows(newData)
125+
// use most recent data, rather than the potentially outdated data passed into watcher handler
126+
self.grid.modifyRows(mostRecentData)
122127
.then(function () {
123128
// if (self.viewport) {
124129
self.grid.redrawInPlace(true);

src/js/core/services/rowSorter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ module.service('rowSorter', ['$parse', 'uiGridConstants', function ($parse, uiGr
206206
var strA = a.toString().toLowerCase(),
207207
strB = b.toString().toLowerCase();
208208

209-
return strA === strB ? 0 : (strA < strB ? -1 : 1);
209+
return strA === strB ? 0 : strA.localeCompare(strB);
210210
}
211211
};
212212

src/less/icons.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@media screen and (-webkit-min-device-pixel-ratio:0) {
1515
@font-face {
1616
font-family: 'ui-grid';
17-
src: url('../font/ui-grid.svg?12312827#ui-grid') format('svg');
17+
src: url('@{font-path}ui-grid.svg?12312827#ui-grid') format('svg');
1818
}
1919
}
2020
*/

0 commit comments

Comments
 (0)