Skip to content

Commit ff4e251

Browse files
DeusEx-Machinadlgski
authored andcommitted
Fix#4658 (#5762)
* Fixes #3832 * chore(less): Propose fix for #4658 Added icon definitions into icons.less and removed fontello from build process #4658
1 parent 12048f1 commit ff4e251

File tree

6 files changed

+115
-26
lines changed

6 files changed

+115
-26
lines changed

grunt/aliases.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = function (grunt, options) {
1010
'default': ['before-test', 'test:single', 'after-test'],
1111

1212
// Build with no testing
13-
'build': ['ngtemplates', 'concat', 'uglify', 'fontello', 'less', 'ngdocs', 'copy:site', 'copy:less_customizer',],
13+
'build': ['ngtemplates', 'concat', 'uglify', 'less', 'ngdocs', 'copy:site', 'copy:less_customizer',],
1414

1515
// Auto-test tasks for development
1616
'autotest:unit': ['karmangular:start'],
@@ -36,11 +36,6 @@ module.exports = function (grunt, options) {
3636
baseTasks['dev'].splice(baseTasks['dev'].indexOf('autotest:unit'), 1);
3737
}
3838

39-
if (grunt.option('fontello') === false) {
40-
grunt.log.writeln("Skipping fontello...");
41-
baseTasks['build'].splice(baseTasks['build'].indexOf('fontello'), 1);
42-
}
43-
4439
if (process.env.TRAVIS){
4540
baseTasks['test:single'] = ['karma:travis'];
4641
}

grunt/watch.js

-5
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ module.exports = function( grunt, options ){
3030
tasks: ['less', 'ngdocs', 'concat:customizer_less']
3131
},
3232

33-
fontello: {
34-
files: 'src/font/config.json',
35-
tasks: ['fontello', 'less']
36-
},
37-
3833
docs: {
3934
files: ['misc/tutorial/**/*.ngdoc', 'misc/api/**/*.ngdoc', 'misc/doc/**'],
4035
tasks: 'ngdocs'

misc/tutorial/116_fonts_and_installation.ngdoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This tutorial addresses the basics of the configuration.
99

1010
Key points here are:
1111

12-
1. Fonts are a derivative of font-awesome via fontello, and are used for the dropdown icons and
12+
1. Fonts are a derivative of font-awesome and are used for the dropdown icons and
1313
various menu buttons and the like. When they're not working they show a "chinese looking" character.
1414
2. The tutorial pages generally show the fonts correctly. If a tutorial page, when served from
1515
ui-grid.info is not showing fonts correctly, then this is likely a defect with ui-grid. If it's

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"grunt-contrib-uglify": "~0.2",
5151
"grunt-contrib-watch": "~0.5",
5252
"grunt-conventional-changelog": "~1.0.0",
53-
"grunt-fontello": "~0.1",
5453
"grunt-gh-pages": "~0.9.0",
5554
"grunt-jscs": "^0.7.1",
5655
"grunt-karma": "~0.8",

src/js/core/factories/GridOptions.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,17 @@ angular.module('ui.grid')
224224
* @ngdoc property
225225
* @name rowHeight
226226
* @propertyOf ui.grid.class:GridOptions
227-
* @description The height of the row in pixels, defaults to 30
227+
* @description The height of the row in pixels, Can be passed as integer or string. defaults to 30.
228228
*
229229
*/
230-
baseOptions.rowHeight = baseOptions.rowHeight || 30;
230+
231+
if (typeof baseOptions.rowHeight === "string") {
232+
baseOptions.rowHeight = parseInt(baseOptions.rowHeight) || 30;
233+
}
234+
235+
else {
236+
baseOptions.rowHeight = baseOptions.rowHeight || 30;
237+
}
231238

232239
/**
233240
* @ngdoc integer

src/less/icons.less

+104-11
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
font-family: 'ui-grid';
33
src: url('@{font-path}ui-grid.eot');
44
src: url('@{font-path}ui-grid.eot#iefix') format('embedded-opentype'),
5-
url('@{font-path}ui-grid.woff') format('woff'),
6-
url('@{font-path}ui-grid.ttf') format('truetype'),
7-
url('@{font-path}ui-grid.svg?#ui-grid') format('svg');
5+
url('@{font-path}ui-grid.woff') format('woff'),
6+
url('@{font-path}ui-grid.ttf') format('truetype'),
7+
url('@{font-path}ui-grid.svg?#ui-grid') format('svg');
88
font-weight: normal;
99
font-style: normal;
1010
}
11+
1112
/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
1213
/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
1314
/*
@@ -18,34 +19,34 @@
1819
}
1920
}
2021
*/
21-
22-
[class^="ui-grid-icon"]:before, [class*=" ui-grid-icon"]:before {
22+
23+
[class^="ui-grid-icon"]:before, [class*=" ui-grid-icon"]:before {
2324
font-family: "ui-grid";
2425
font-style: normal;
2526
font-weight: normal;
2627
speak: none;
27-
28+
2829
display: inline-block;
2930
text-decoration: inherit;
3031
width: 1em;
3132
margin-right: .2em;
3233
text-align: center;
3334
/* opacity: .8; */
34-
35+
3536
/* For safety - reset parent styles, that can break glyph codes*/
3637
font-variant: normal;
3738
text-transform: none;
38-
39+
3940
/* fix buttons height, for twitter bootstrap */
4041
line-height: 1em;
41-
42+
4243
/* Animation center compensation - margins should be symmetric */
4344
/* remove if not needed */
4445
margin-left: .2em;
45-
46+
4647
/* you can be more comfortable with increased icons size */
4748
/* font-size: 120%; */
48-
49+
4950
/* Uncomment for 3D effect */
5051
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
5152
}
@@ -54,3 +55,95 @@
5455
width: 1em;
5556
content: ' ';
5657
}
58+
59+
.ui-grid-icon-plus-squared:before {
60+
content: '\c350'
61+
}
62+
63+
.ui-grid-icon-minus-squared:before {
64+
content: '\c351'
65+
}
66+
67+
.ui-grid-icon-search:before {
68+
content: '\c352'
69+
}
70+
71+
.ui-grid-icon-cancel:before {
72+
content: '\c353'
73+
}
74+
75+
.ui-grid-icon-info-circled:before {
76+
content: '\c354'
77+
}
78+
79+
.ui-grid-icon-lock:before {
80+
content: '\c355'
81+
}
82+
83+
.ui-grid-icon-lock-open:before {
84+
content: '\c356'
85+
}
86+
87+
.ui-grid-icon-pencil:before {
88+
content: '\c357'
89+
}
90+
91+
.ui-grid-icon-down-dir:before {
92+
content: '\c358'
93+
}
94+
95+
.ui-grid-icon-up-dir:before {
96+
content: '\c359'
97+
}
98+
99+
.ui-grid-icon-left-dir:before {
100+
content: '\c35a'
101+
}
102+
103+
.ui-grid-icon-right-dir:before {
104+
content: '\c35b'
105+
}
106+
107+
.ui-grid-icon-left-open:before {
108+
content: '\c35c'
109+
}
110+
111+
.ui-grid-icon-right-open:before {
112+
content: '\c35d'
113+
}
114+
115+
.ui-grid-icon-angle-down:before {
116+
content: '\c35e'
117+
}
118+
119+
.ui-grid-icon-filter:before {
120+
content: '\c35f'
121+
}
122+
123+
.ui-grid-icon-sort-alt-up:before {
124+
content: '\c360'
125+
}
126+
127+
.ui-grid-icon-sort-alt-down:before {
128+
content: '\c361'
129+
}
130+
131+
.ui-grid-icon-ok:before {
132+
content: '\c362'
133+
}
134+
135+
.ui-grid-icon-menu:before {
136+
content: '\c363'
137+
}
138+
139+
.ui-grid-icon-indent-left:before {
140+
content: '\e800'
141+
}
142+
143+
.ui-grid-icon-indent-right:before {
144+
content: '\e801'
145+
}
146+
147+
.ui-grid-icon-spin5:before {
148+
content: '\ea61'
149+
}

0 commit comments

Comments
 (0)