diff --git a/grunt/aliases.js b/grunt/aliases.js
index e927f7ce68..7e4422fea5 100644
--- a/grunt/aliases.js
+++ b/grunt/aliases.js
@@ -10,7 +10,7 @@ module.exports = function (grunt, options) {
'default': ['before-test', 'test:single', 'after-test'],
// Build with no testing
- 'build': ['ngtemplates', 'concat', 'uglify', 'fontello', 'less', 'ngdocs', 'copy:site', 'copy:less_customizer',],
+ 'build': ['ngtemplates', 'concat', 'uglify', 'less', 'ngdocs', 'copy:site', 'copy:less_customizer',],
// Auto-test tasks for development
'autotest:unit': ['karmangular:start'],
@@ -36,11 +36,6 @@ module.exports = function (grunt, options) {
baseTasks['dev'].splice(baseTasks['dev'].indexOf('autotest:unit'), 1);
}
- if (grunt.option('fontello') === false) {
- grunt.log.writeln("Skipping fontello...");
- baseTasks['build'].splice(baseTasks['build'].indexOf('fontello'), 1);
- }
-
if (process.env.TRAVIS){
baseTasks['test:single'] = ['karma:travis'];
}
diff --git a/grunt/watch.js b/grunt/watch.js
index 8bb6bd98f3..3f0ceeafad 100644
--- a/grunt/watch.js
+++ b/grunt/watch.js
@@ -30,11 +30,6 @@ module.exports = function( grunt, options ){
tasks: ['less', 'ngdocs', 'concat:customizer_less']
},
- fontello: {
- files: 'src/font/config.json',
- tasks: ['fontello', 'less']
- },
-
docs: {
files: ['misc/tutorial/**/*.ngdoc', 'misc/api/**/*.ngdoc', 'misc/doc/**'],
tasks: 'ngdocs'
diff --git a/misc/tutorial/116_fonts_and_installation.ngdoc b/misc/tutorial/116_fonts_and_installation.ngdoc
index 83ba66d08e..bb574d5490 100644
--- a/misc/tutorial/116_fonts_and_installation.ngdoc
+++ b/misc/tutorial/116_fonts_and_installation.ngdoc
@@ -9,7 +9,7 @@ This tutorial addresses the basics of the configuration.
Key points here are:
-1. Fonts are a derivative of font-awesome via fontello, and are used for the dropdown icons and
+1. Fonts are a derivative of font-awesome and are used for the dropdown icons and
various menu buttons and the like. When they're not working they show a "chinese looking" character.
2. The tutorial pages generally show the fonts correctly. If a tutorial page, when served from
ui-grid.info is not showing fonts correctly, then this is likely a defect with ui-grid. If it's
diff --git a/package.json b/package.json
index 794b2f9d93..7b312647ea 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,6 @@
"grunt-contrib-uglify": "~0.2",
"grunt-contrib-watch": "~0.5",
"grunt-conventional-changelog": "~1.0.0",
- "grunt-fontello": "~0.1",
"grunt-gh-pages": "~0.9.0",
"grunt-jscs": "^0.7.1",
"grunt-karma": "~0.8",
diff --git a/src/features/edit/js/gridEdit.js b/src/features/edit/js/gridEdit.js
index eff7c66ecc..8c7df01879 100644
--- a/src/features/edit/js/gridEdit.js
+++ b/src/features/edit/js/gridEdit.js
@@ -966,9 +966,20 @@
});
}
- $elm.on('blur', function (evt) {
- $scope.stopEdit(evt);
+ // macOS will blur the checkbox when clicked in Safari and Firefox,
+ // to get around this, we disable the blur handler on mousedown,
+ // and then focus the checkbox and re-enable the blur handler after $timeout
+ $elm.on('mousedown', function(evt) {
+ if ($elm[0].type === 'checkbox') {
+ $elm.off('blur', $scope.stopEdit);
+ $timeout(function() {
+ $elm.focus();
+ $elm.on('blur', $scope.stopEdit);
+ });
+ }
});
+
+ $elm.on('blur', $scope.stopEdit);
});
@@ -1132,9 +1143,9 @@
//set focus at start of edit
$scope.$on(uiGridEditConstants.events.BEGIN_CELL_EDIT, function () {
$timeout(function(){
- $elm[0].focus();
+ $elm[0].focus();
});
-
+
$elm[0].style.width = ($elm[0].parentElement.offsetWidth - 1) + 'px';
$elm.on('blur', function (evt) {
$scope.stopEdit(evt);
diff --git a/src/features/exporter/js/exporter.js b/src/features/exporter/js/exporter.js
index 55845f151d..ca246a2048 100755
--- a/src/features/exporter/js/exporter.js
+++ b/src/features/exporter/js/exporter.js
@@ -235,6 +235,14 @@
*
Defaults to false
*/
gridOptions.exporterOlderExcelCompatibility = gridOptions.exporterOlderExcelCompatibility === true;
+ /**
+ * @ngdoc object
+ * @name exporterMenuItemOrder
+ * @propertyOf ui.grid.exporter.api:GridOptions
+ * @description An option to determine the starting point for the menu items created by the exporter
+ *
Defaults to 200
+ */
+ gridOptions.exporterMenuItemOrder = gridOptions.exporterMenuItemOrder ? gridOptions.exporterMenuItemOrder : 200;
/**
* @ngdoc object
* @name exporterPdfDefaultStyle
@@ -547,7 +555,7 @@
shown: function() {
return this.grid.options.exporterMenuCsv && this.grid.options.exporterMenuAllData;
},
- order: 200
+ order: grid.options.exporterMenuItemOrder
},
{
title: i18nService.getSafeText('gridMenu.exporterVisibleAsCsv'),
@@ -557,7 +565,7 @@
shown: function() {
return this.grid.options.exporterMenuCsv && this.grid.options.exporterMenuVisibleData;
},
- order: 201
+ order: grid.options.exporterMenuItemOrder + 1
},
{
title: i18nService.getSafeText('gridMenu.exporterSelectedAsCsv'),
@@ -568,7 +576,7 @@
return this.grid.options.exporterMenuCsv && this.grid.options.exporterMenuSelectedData &&
( this.grid.api.selection && this.grid.api.selection.getSelectedRows().length > 0 );
},
- order: 202
+ order: grid.options.exporterMenuItemOrder + 2
},
{
title: i18nService.getSafeText('gridMenu.exporterAllAsPdf'),
@@ -578,7 +586,7 @@
shown: function() {
return this.grid.options.exporterMenuPdf && this.grid.options.exporterMenuAllData;
},
- order: 203
+ order: grid.options.exporterMenuItemOrder + 3
},
{
title: i18nService.getSafeText('gridMenu.exporterVisibleAsPdf'),
@@ -588,7 +596,7 @@
shown: function() {
return this.grid.options.exporterMenuPdf && this.grid.options.exporterMenuVisibleData;
},
- order: 204
+ order: grid.options.exporterMenuItemOrder + 4
},
{
title: i18nService.getSafeText('gridMenu.exporterSelectedAsPdf'),
@@ -599,7 +607,7 @@
return this.grid.options.exporterMenuPdf && this.grid.options.exporterMenuSelectedData &&
( this.grid.api.selection && this.grid.api.selection.getSelectedRows().length > 0 );
},
- order: 205
+ order: grid.options.exporterMenuItemOrder + 5
}
]);
},
diff --git a/src/features/exporter/test/exporter.spec.js b/src/features/exporter/test/exporter.spec.js
index 4d6bbc5da7..9c2ed6a996 100644
--- a/src/features/exporter/test/exporter.spec.js
+++ b/src/features/exporter/test/exporter.spec.js
@@ -92,7 +92,8 @@ describe('ui.grid.exporter uiGridExporterService', function () {
exporterMenuPdf: true,
exporterFieldCallback: jasmine.any(Function),
exporterAllDataFn: null,
- exporterSuppressColumns: []
+ exporterSuppressColumns: [],
+ exporterMenuItemOrder: 200
});
});
@@ -122,7 +123,8 @@ describe('ui.grid.exporter uiGridExporterService', function () {
exporterMenuPdf: false,
exporterFieldCallback: callback,
exporterAllDataPromise: callback,
- exporterSuppressColumns: [ 'buttons' ]
+ exporterSuppressColumns: [ 'buttons' ],
+ exporterMenuItemOrder: 75
};
uiGridExporterService.defaultGridOptions(options);
expect( options ).toEqual({
@@ -150,7 +152,8 @@ describe('ui.grid.exporter uiGridExporterService', function () {
exporterFieldCallback: callback,
exporterAllDataFn: callback,
exporterAllDataPromise: callback,
- exporterSuppressColumns: [ 'buttons' ]
+ exporterSuppressColumns: [ 'buttons' ],
+ exporterMenuItemOrder: 75
});
});
});
diff --git a/src/js/core/constants.js b/src/js/core/constants.js
index ef9f0f1629..917f6bdf7a 100644
--- a/src/js/core/constants.js
+++ b/src/js/core/constants.js
@@ -190,7 +190,26 @@
LEFT: 'left',
RIGHT: 'right',
NONE: 'none'
+ },
+ /**
+ * @ngdoc object
+ * @name scrollType
+ * @propertyOf ui.grid.service:uiGridConstants
+ * @description Used in {@link ui.grid.class:gridScrolling},
+ * to the type of scroll event currently in progress
+ *
+ * Available options are:
+ * - `uiGridConstants.scrollEvent.NONE` - set when no scroll events are being triggered
+ * - `uiGridConstants.scrollEvent.TOUCHABLE` - set when touchstart, touchmove or touchend are triggered
+ * - `uiGridConstants.scrollEvent.MOUSE` - set when mousedown, mousemove or mouseup are triggered
+ * - `uiGridConstants.scrollEvent.POINTER` - set when pointerdown, pointermove or pointerup are triggered
+ */
+ scrollType: {
+ NONE: 0,
+ TOUCHABLE: 1,
+ MOUSE: 2,
+ POINTER: 3
},
/**
diff --git a/src/js/core/directives/ui-grid-viewport.js b/src/js/core/directives/ui-grid-viewport.js
index 712cd8c425..057039d88a 100644
--- a/src/js/core/directives/ui-grid-viewport.js
+++ b/src/js/core/directives/ui-grid-viewport.js
@@ -1,8 +1,8 @@
(function(){
'use strict';
- angular.module('ui.grid').directive('uiGridViewport', ['gridUtil','ScrollEvent','uiGridConstants', '$log',
- function(gridUtil, ScrollEvent, uiGridConstants, $log) {
+ angular.module('ui.grid').directive('uiGridViewport', ['gridUtil','ScrollEvent','uiGridConstants', '$log', 'gridScrolling',
+ function(gridUtil, ScrollEvent, uiGridConstants, $log, gridScrolling) {
return {
replace: true,
scope: {},
@@ -31,8 +31,7 @@
// Register this viewport with its container
containerCtrl.viewport = $elm;
-
- $elm.on('scroll', scrollHandler);
+ gridScrolling($elm, scrollHandler);
var ignoreScroll = false;
diff --git a/src/js/core/factories/GridApi.js b/src/js/core/factories/GridApi.js
index 594bae0a32..cd0049753c 100644
--- a/src/js/core/factories/GridApi.js
+++ b/src/js/core/factories/GridApi.js
@@ -66,7 +66,7 @@
* which will override any filtering or other visibility calculations.
* If the row is currently visible then sets it to invisible and calls
* both grid refresh and emits the rowsVisibleChanged event
- * @param {object} rowEntity gridOptions.data[] array instance
+ * @param {GridRow} row the row we want to make invisible
*/
this.registerMethod( 'core', 'setRowInvisible', GridRow.prototype.setRowInvisible );
@@ -79,7 +79,7 @@
* If the row is currently invisible then sets it to visible and calls
* both grid refresh and emits the rowsVisibleChanged event
* TODO: if a filter is active then we can't just set it to visible?
- * @param {object} rowEntity gridOptions.data[] array instance
+ * @param {GridRow} row the row we want to make visible
*/
this.registerMethod( 'core', 'clearRowInvisible', GridRow.prototype.clearRowInvisible );
diff --git a/src/js/core/factories/GridOptions.js b/src/js/core/factories/GridOptions.js
index e3a944cb7b..512988daaa 100644
--- a/src/js/core/factories/GridOptions.js
+++ b/src/js/core/factories/GridOptions.js
@@ -224,10 +224,17 @@ angular.module('ui.grid')
* @ngdoc property
* @name rowHeight
* @propertyOf ui.grid.class:GridOptions
- * @description The height of the row in pixels, defaults to 30
+ * @description The height of the row in pixels, Can be passed as integer or string. defaults to 30.
*
*/
- baseOptions.rowHeight = baseOptions.rowHeight || 30;
+
+ if (typeof baseOptions.rowHeight === "string") {
+ baseOptions.rowHeight = parseInt(baseOptions.rowHeight) || 30;
+ }
+
+ else {
+ baseOptions.rowHeight = baseOptions.rowHeight || 30;
+ }
/**
* @ngdoc integer
diff --git a/src/js/core/factories/GridRenderContainer.js b/src/js/core/factories/GridRenderContainer.js
index 5a4fd67b6a..7f4bba9d4a 100644
--- a/src/js/core/factories/GridRenderContainer.js
+++ b/src/js/core/factories/GridRenderContainer.js
@@ -300,11 +300,11 @@ angular.module('ui.grid')
};
GridRenderContainer.prototype.getVerticalScrollLength = function getVerticalScrollLength() {
- return this.getCanvasHeight() - this.getViewportHeight() + this.grid.scrollbarHeight;
+ return this.getCanvasHeight() - this.getViewportHeight() + this.grid.scrollbarHeight !== 0 ? this.getCanvasHeight() - this.getViewportHeight() + this.grid.scrollbarHeight : -1;
};
GridRenderContainer.prototype.getHorizontalScrollLength = function getHorizontalScrollLength() {
- return this.getCanvasWidth() - this.getViewportWidth() + this.grid.scrollbarWidth;
+ return this.getCanvasWidth() - this.getViewportWidth() + this.grid.scrollbarWidth !== 0 ? this.getCanvasWidth() - this.getViewportWidth() + this.grid.scrollbarWidth : -1;
};
GridRenderContainer.prototype.getCanvasWidth = function getCanvasWidth() {
diff --git a/src/js/core/factories/GridScrolling.js b/src/js/core/factories/GridScrolling.js
new file mode 100644
index 0000000000..705b64e02e
--- /dev/null
+++ b/src/js/core/factories/GridScrolling.js
@@ -0,0 +1,300 @@
+(function() {
+ 'use strict';
+
+ angular.module('ui.grid')
+ .factory('gridScrolling', ['$window', 'gridUtil', 'uiGridConstants',
+ function($window, gridUtil, uiGridConstants) {
+ var isAnimating;
+
+ /**
+ * @ngdoc object
+ * @name initiated
+ * @propertyOf ui.grid.class:gridScrolling
+ * @description Keeps track of which type of scrolling event has been initiated
+ * and sets it to NONE, when no event is being triggered.
+ */
+ gridScrolling.initiated = uiGridConstants.scrollType.NONE;
+
+ /**
+ * @ngdoc function
+ * @name ui.grid.class:gridScrolling
+ * @description gridScrolling is a wrapper service that takes over the default scrolling logic in order to
+ * ensure that grid scrolling works consistently in both the browser and devices, as well as slow machines.
+ * @param {object} element Element being scrolled
+ * @param {function} scrollHandler Function that needs to be called when scrolling happens.
+ */
+ function gridScrolling(element, scrollHandler) {
+ var wrapper = element, pointX, pointY, startTime, startX, startY, maxScroll,
+ scroller = wrapper[0].children[0],
+ initType = {
+ touchstart: uiGridConstants.scrollType.TOUCHABLE,
+ touchmove: uiGridConstants.scrollType.TOUCHABLE,
+ touchend: uiGridConstants.scrollType.TOUCHABLE,
+
+ mousedown: uiGridConstants.scrollType.MOUSE,
+ mousemove: uiGridConstants.scrollType.MOUSE,
+ mouseup: uiGridConstants.scrollType.MOUSE,
+
+ pointerdown: uiGridConstants.scrollType.POINTER,
+ pointermove: uiGridConstants.scrollType.POINTER,
+ pointerup: uiGridConstants.scrollType.POINTER
+ };
+
+ if ('onmousedown' in $window) {
+ wrapper.on('scroll', scrollHandler);
+ }
+
+ if (gridUtil.isTouchEnabled()) {
+ wrapper.on('touchstart', start);
+ wrapper.on('touchmove', move);
+ wrapper.on('touchcancel', end);
+ wrapper.on('touchend', end);
+ document.addEventListener('touchmove', function(e) {
+ e.preventDefault();
+ }, false);
+ }
+
+ /**
+ * @ngdoc function
+ * @name start
+ * @methodOf ui.grid.class:gridScrolling
+ * @description Gets the current coordinates and time, as well as the target coordinate
+ * and initializes the scrolling event
+ * @param {object} event The event object
+ */
+ function start(event) {
+ var point = event.touches ? event.touches[0] : event;
+
+ wrapper.off('scroll', scrollHandler);
+
+ gridScrolling.initiated = initType[event.type];
+
+ pointX = point.pageX;
+ pointY = point.pageY;
+
+ startTime = (new Date()).getTime();
+ startX = wrapper[0].scrollLeft;
+ startY = wrapper[0].scrollTop;
+ isAnimating = false;
+ }
+
+ /**
+ * @ngdoc function
+ * @name calcNewMove
+ * @methodOf ui.grid.class:gridScrolling
+ * @description Calculates the next position of the element for a particular axis
+ * based on the delta.
+ * @param {number} scrollPos The original position of the element.
+ * @param {number} delta The amount the pointer moved.
+ * @param {number} axis The original position.
+ * @returns {number} The next position of the element.
+ */
+ function calcNewMove(scrollPos, delta, axis) {
+ var newMove = scrollPos + delta;
+
+ if (newMove < 0 || newMove > getMaxScroll()[axis]) {
+ newMove = newMove < 0 ? 0 : getMaxScroll()[axis];
+ }
+
+ return newMove;
+ }
+
+ /**
+ * @ngdoc function
+ * @name move
+ * @methodOf ui.grid.class:gridScrolling
+ * @description Calculates what the next move should be and starts the scrolling.
+ * @param {object} event The event object
+ */
+ function move(event) {
+ if (initType[event.type] !== gridScrolling.initiated) {
+ return;
+ }
+
+ var newX, newY, timestamp = (new Date()).getTime(),
+ point = event.touches ? event.touches[0] : event,
+ deltaX = pointX - point.pageX,
+ deltaY = pointY - point.pageY;
+
+ pointX = point.pageX;
+ pointY = point.pageY;
+
+ newX = calcNewMove(wrapper[0].scrollLeft, deltaX, 'x');
+ newY = calcNewMove(wrapper[0].scrollTop, deltaY, 'y');
+
+ if (timestamp - startTime > 300) {
+ startTime = (new Date()).getTime();
+ startX = newX;
+ startY = newY;
+ }
+
+ translate(newX, newY, wrapper);
+
+ scrollHandler.call(null, event);
+ }
+
+ /**
+ * @ngdoc function
+ * @name end
+ * @methodOf ui.grid.class:gridScrolling
+ * @description Finishes the scrolling animation.
+ * @param {object} event The event object
+ */
+ function end(event) {
+ if (initType[event.type] !== gridScrolling.initiated) {
+ return;
+ }
+
+ var duration = (new Date()).getTime() - startTime,
+ momentumX = momentum(wrapper[0].scrollLeft, startX, duration),
+ momentumY = momentum(wrapper[0].scrollTop, startY, duration),
+ newX = momentumX.destination,
+ newY = momentumY.destination,
+ time = Math.max(momentumX.duration, momentumY.duration);
+
+ animate(newX, newY, time, wrapper, scrollHandler.bind(null, event));
+
+ gridScrolling.initiated = uiGridConstants.scrollType.NONE;
+ }
+
+ /**
+ * @ngdoc function
+ * @name momentum
+ * @methodOf ui.grid.class:gridScrolling
+ * @description Calculates current momentum of the scrolling based on the current position of the element,
+ * its initial position and the duration of this movement.
+ * @param {number} curr The current position of the element
+ * @param {number} start The original position of the element
+ * @param {number} time The time it has taken for the element to get to its current position.
+ * @returns {object} An object with the next position for the element and how long
+ * that animation should take.
+ */
+ function momentum(curr, start, time) {
+ curr = Math.abs(curr);
+ start = Math.abs(start);
+
+ var distance = curr - start,
+ speed = Math.abs(distance) / time,
+ deceleration = 0.0007,
+ destination = curr + (speed * speed) / (2 * deceleration) * (distance >= 0 ? 1 : -1),
+ duration = speed / deceleration;
+
+ return {
+ destination: Math.round(destination),
+ duration: duration
+ };
+ }
+
+ /**
+ * @ngdoc function
+ * @name getMaxScroll
+ * @methodOf ui.grid.class:gridScrolling
+ * @description Gets the limit of the scrolling for both the x and y positions.
+ * @returns {object} An object with the x and y scroll limits.
+ */
+ function getMaxScroll() {
+ if (!maxScroll) {
+ maxScroll = {
+ x: scroller.offsetWidth - wrapper[0].clientWidth,
+ y: scroller.offsetHeight - wrapper[0].clientHeight
+ };
+ }
+ return maxScroll;
+ }
+ }
+
+ /**
+ * @ngdoc function
+ * @name translate
+ * @methodOf ui.grid.class:gridScrolling
+ * @description Updates the wrapper's scroll position.
+ * @param {number} x The horizontal position of the wrapper
+ * @param {number} y The vertical position of the wrapper
+ * @param {object} wrapper The wrapper element being updated
+ */
+ function translate(x, y, wrapper) {
+ wrapper[0].scrollLeft = x;
+ wrapper[0].scrollTop = y;
+ }
+
+ /**
+ * @ngdoc function
+ * @name easeClb
+ * @methodOf ui.grid.class:gridScrolling
+ * @description Calculates the ease resolution base on the current animation times.
+ * @param {number} relPoint The time the animation is taking between frames.
+ * @returns {number} The ideal ease time.
+ */
+ function easeClb(relPoint) {
+ return relPoint * ( 2 - relPoint );
+ }
+
+ /**
+ * @ngdoc function
+ * @name calcNewPos
+ * @methodOf ui.grid.class:gridScrolling
+ * @description Calculates the new position of the element based on where it started, the animation time
+ * and where it is ultimately supposed to end up.
+ * @param {number} destPos The destination.
+ * @param {number} easeRes The ideal ease time.
+ * @param {number} startPos The original position.
+ * @returns {number} The next position of the element.
+ */
+ function calcNewPos(destPos, easeRes, startPos) {
+ return ( destPos - Math.abs(startPos) ) * easeRes + Math.abs(startPos);
+ }
+
+ /**
+ * @ngdoc function
+ * @name animate
+ * @methodOf ui.grid.class:gridScrolling
+ * @description Calculates the ease resolution base on the current animation times.
+ * @param {number} destX The coordinate of the x axis that the scrolling needs to animate to.
+ * @param {number} destY The coordinate of the y axis that the scrolling needs to animate to.
+ * @param {number} duration The animation duration
+ * @param {object} wrapper The wrapper element being updated
+ * @param {function} callback Function that needs to be called when the animation is done.
+ */
+ function animate(destX, destY, duration, wrapper, callback) {
+ var startTime = (new Date()).getTime(),
+ startX = wrapper[0].scrollLeft,
+ startY = wrapper[0].scrollTop,
+ destTime = startTime + duration;
+
+ isAnimating = true;
+
+ next();
+
+ function next() {
+ var now = (new Date()).getTime(),
+ relPoint, easeRes, newX, newY;
+
+ if (now >= destTime) {
+ isAnimating = false;
+ translate(destX, destY, wrapper);
+ wrapper.on('scroll', callback);
+ return;
+ }
+
+ relPoint = (now - startTime) / duration;
+
+ easeRes = easeClb(relPoint);
+
+ newX = calcNewPos(destX, easeRes, startX);
+ newY = calcNewPos(destY, easeRes, startY);
+
+ translate(newX, newY, wrapper);
+
+ callback.call();
+
+ if (isAnimating) {
+ window.requestAnimationFrame(next);
+ } else {
+ wrapper.on('scroll', callback);
+ }
+ }
+ }
+
+ return gridScrolling;
+ }]);
+})();
diff --git a/src/js/core/services/rowSorter.js b/src/js/core/services/rowSorter.js
index e918d45735..9626a8934e 100644
--- a/src/js/core/services/rowSorter.js
+++ b/src/js/core/services/rowSorter.js
@@ -358,11 +358,11 @@ module.service('rowSorter', ['$parse', 'uiGridConstants', function ($parse, uiGr
}
}
// Only A has a priority
- else if (a.sort.priority || a.sort.priority === undefined) {
+ else if (a.sort.priority !== undefined) {
return -1;
}
// Only B has a priority
- else if (b.sort.priority || b.sort.priority === undefined) {
+ else if (b.sort.priority !== undefined) {
return 1;
}
// Neither has a priority
diff --git a/src/less/icons.less b/src/less/icons.less
index 28a081a1f4..1519d14614 100644
--- a/src/less/icons.less
+++ b/src/less/icons.less
@@ -2,12 +2,13 @@
font-family: 'ui-grid';
src: url('@{font-path}ui-grid.eot');
src: url('@{font-path}ui-grid.eot#iefix') format('embedded-opentype'),
- url('@{font-path}ui-grid.woff') format('woff'),
- url('@{font-path}ui-grid.ttf') format('truetype'),
- url('@{font-path}ui-grid.svg?#ui-grid') format('svg');
+ url('@{font-path}ui-grid.woff') format('woff'),
+ url('@{font-path}ui-grid.ttf') format('truetype'),
+ url('@{font-path}ui-grid.svg?#ui-grid') format('svg');
font-weight: normal;
font-style: normal;
}
+
/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
/*
@@ -18,34 +19,34 @@
}
}
*/
-
- [class^="ui-grid-icon"]:before, [class*=" ui-grid-icon"]:before {
+
+[class^="ui-grid-icon"]:before, [class*=" ui-grid-icon"]:before {
font-family: "ui-grid";
font-style: normal;
font-weight: normal;
speak: none;
-
+
display: inline-block;
text-decoration: inherit;
width: 1em;
margin-right: .2em;
text-align: center;
/* opacity: .8; */
-
+
/* For safety - reset parent styles, that can break glyph codes*/
font-variant: normal;
text-transform: none;
-
+
/* fix buttons height, for twitter bootstrap */
line-height: 1em;
-
+
/* Animation center compensation - margins should be symmetric */
/* remove if not needed */
margin-left: .2em;
-
+
/* you can be more comfortable with increased icons size */
/* font-size: 120%; */
-
+
/* Uncomment for 3D effect */
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
}
@@ -54,3 +55,95 @@
width: 1em;
content: ' ';
}
+
+.ui-grid-icon-plus-squared:before {
+ content: '\c350'
+}
+
+.ui-grid-icon-minus-squared:before {
+ content: '\c351'
+}
+
+.ui-grid-icon-search:before {
+ content: '\c352'
+}
+
+.ui-grid-icon-cancel:before {
+ content: '\c353'
+}
+
+.ui-grid-icon-info-circled:before {
+ content: '\c354'
+}
+
+.ui-grid-icon-lock:before {
+ content: '\c355'
+}
+
+.ui-grid-icon-lock-open:before {
+ content: '\c356'
+}
+
+.ui-grid-icon-pencil:before {
+ content: '\c357'
+}
+
+.ui-grid-icon-down-dir:before {
+ content: '\c358'
+}
+
+.ui-grid-icon-up-dir:before {
+ content: '\c359'
+}
+
+.ui-grid-icon-left-dir:before {
+ content: '\c35a'
+}
+
+.ui-grid-icon-right-dir:before {
+ content: '\c35b'
+}
+
+.ui-grid-icon-left-open:before {
+ content: '\c35c'
+}
+
+.ui-grid-icon-right-open:before {
+ content: '\c35d'
+}
+
+.ui-grid-icon-angle-down:before {
+ content: '\c35e'
+}
+
+.ui-grid-icon-filter:before {
+ content: '\c35f'
+}
+
+.ui-grid-icon-sort-alt-up:before {
+ content: '\c360'
+}
+
+.ui-grid-icon-sort-alt-down:before {
+ content: '\c361'
+}
+
+.ui-grid-icon-ok:before {
+ content: '\c362'
+}
+
+.ui-grid-icon-menu:before {
+ content: '\c363'
+}
+
+.ui-grid-icon-indent-left:before {
+ content: '\e800'
+}
+
+.ui-grid-icon-indent-right:before {
+ content: '\e801'
+}
+
+.ui-grid-icon-spin5:before {
+ content: '\ea61'
+}