Skip to content

Commit

Permalink
Fix#4658 (angular-ui#5762)
Browse files Browse the repository at this point in the history
* Fixes angular-ui#3832

* chore(less): Propose fix for angular-ui#4658

Added icon definitions into icons.less and removed fontello from build process

angular-ui#4658
  • Loading branch information
DeusEx-Machina authored and Rodrigo de Bona Sartor committed May 24, 2018
1 parent d7f00ec commit 58c2985
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 21 deletions.
2 changes: 1 addition & 1 deletion grunt/aliases.js
Expand Up @@ -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'],
Expand Down
5 changes: 0 additions & 5 deletions grunt/watch.js
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion misc/tutorial/116_fonts_and_installation.ngdoc
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -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",
Expand Down
11 changes: 9 additions & 2 deletions src/js/core/factories/GridOptions.js
Expand Up @@ -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
Expand Down
115 changes: 104 additions & 11 deletions src/less/icons.less
Expand Up @@ -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 */
/*
Expand All @@ -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); */
}
Expand All @@ -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'
}

0 comments on commit 58c2985

Please sign in to comment.