Skip to content

Commit 2447579

Browse files
committed
Add normalizeIconClass filter
1 parent 244f136 commit 2447579

File tree

4 files changed

+47
-1
lines changed

4 files changed

+47
-1
lines changed

dist/origin-web-common-ui.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,6 +1582,20 @@ angular.module('openshiftCommonUI')
15821582
});
15831583
;'use strict';
15841584

1585+
angular.module("openshiftCommonUI")
1586+
.filter("normalizeIconClass", function() {
1587+
return function(iconClass) {
1588+
// if iconClass starts with "icon-", append "font-icon "
1589+
// so the Openshift Logos Icon font is used
1590+
if(_.startsWith(iconClass, "icon-")) {
1591+
return "font-icon " + iconClass;
1592+
} else {
1593+
return iconClass;
1594+
}
1595+
};
1596+
});
1597+
;'use strict';
1598+
15851599
angular.module('openshiftCommonUI')
15861600
.filter('parseJSON', function() {
15871601
return function(json) {

dist/origin-web-common.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1788,6 +1788,20 @@ angular.module('openshiftCommonUI')
17881788
}]);
17891789
;'use strict';
17901790

1791+
angular.module("openshiftCommonUI")
1792+
.filter("normalizeIconClass", function() {
1793+
return function(iconClass) {
1794+
// if iconClass starts with "icon-", append "font-icon "
1795+
// so the Openshift Logos Icon font is used
1796+
if(_.startsWith(iconClass, "icon-")) {
1797+
return "font-icon " + iconClass;
1798+
} else {
1799+
return iconClass;
1800+
}
1801+
};
1802+
});
1803+
;'use strict';
1804+
17911805
angular.module('openshiftCommonUI')
17921806
.filter('parseJSON', function() {
17931807
return function(json) {

dist/origin-web-common.min.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,11 @@ return uri.is("absolute") && ("http" === protocol || "https" === protocol);
835835
return function(text, target, alreadyEscaped) {
836836
return HTMLService.linkify(text, target, alreadyEscaped);
837837
};
838-
} ]), angular.module("openshiftCommonUI").filter("parseJSON", function() {
838+
} ]), angular.module("openshiftCommonUI").filter("normalizeIconClass", function() {
839+
return function(iconClass) {
840+
return _.startsWith(iconClass, "icon-") ? "font-icon " + iconClass :iconClass;
841+
};
842+
}), angular.module("openshiftCommonUI").filter("parseJSON", function() {
839843
return function(json) {
840844
if (!json) return null;
841845
try {

src/filters/normalizeIconClass.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'use strict';
2+
3+
angular.module("openshiftCommonUI")
4+
.filter("normalizeIconClass", function() {
5+
return function(iconClass) {
6+
// if iconClass starts with "icon-", append "font-icon "
7+
// so the Openshift Logos Icon font is used
8+
if(_.startsWith(iconClass, "icon-")) {
9+
return "font-icon " + iconClass;
10+
} else {
11+
return iconClass;
12+
}
13+
};
14+
});

0 commit comments

Comments
 (0)