Release 5.8.2 (#1361)
This commit is contained in:
@@ -916,7 +916,7 @@
|
||||
'data-prefix': prefix,
|
||||
'data-icon': iconName,
|
||||
'class': attrClass,
|
||||
'role': 'img',
|
||||
'role': extra.attributes.role || 'img',
|
||||
'xmlns': 'http://www.w3.org/2000/svg',
|
||||
'viewBox': "0 0 ".concat(width, " ").concat(height)
|
||||
})
|
||||
@@ -1057,7 +1057,7 @@
|
||||
mark: noop$1,
|
||||
measure: noop$1
|
||||
};
|
||||
var preamble = "FA \"5.8.1\"";
|
||||
var preamble = "FA \"5.8.2\"";
|
||||
|
||||
var begin = function begin(name) {
|
||||
p.mark("".concat(preamble, " ").concat(name, " begins"));
|
||||
@@ -1124,6 +1124,17 @@
|
||||
return result;
|
||||
};
|
||||
|
||||
function toHex(unicode) {
|
||||
var result = '';
|
||||
|
||||
for (var i = 0; i < unicode.length; i++) {
|
||||
var hex = unicode.charCodeAt(i).toString(16);
|
||||
result += ('000' + hex).slice(-4);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function defineIcons(prefix, icons) {
|
||||
var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
var _params$skipHooks = params.skipHooks,
|
||||
@@ -1206,10 +1217,10 @@
|
||||
};
|
||||
build();
|
||||
function byUnicode(prefix, unicode) {
|
||||
return _byUnicode[prefix][unicode];
|
||||
return (_byUnicode[prefix] || {})[unicode];
|
||||
}
|
||||
function byLigature(prefix, ligature) {
|
||||
return _byLigature[prefix][ligature];
|
||||
return (_byLigature[prefix] || {})[ligature];
|
||||
}
|
||||
function byOldName(name) {
|
||||
return _byOldName[name] || {
|
||||
@@ -1444,17 +1455,6 @@
|
||||
return val;
|
||||
}
|
||||
|
||||
function toHex(unicode) {
|
||||
var result = '';
|
||||
|
||||
for (var i = 0; i < unicode.length; i++) {
|
||||
var hex = unicode.charCodeAt(i).toString(16);
|
||||
result += ('000' + hex).slice(-4);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function classParser (node) {
|
||||
var existingPrefix = node.getAttribute('data-prefix');
|
||||
var existingIconName = node.getAttribute('data-icon');
|
||||
@@ -1838,7 +1838,12 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var candidates = toArray(root.querySelectorAll(prefixesDomQuery));
|
||||
var candidates = [];
|
||||
|
||||
try {
|
||||
candidates = toArray(root.querySelectorAll(prefixesDomQuery));
|
||||
} catch (e) {// noop
|
||||
}
|
||||
|
||||
if (candidates.length > 0) {
|
||||
hclAdd('pending');
|
||||
@@ -1915,11 +1920,13 @@
|
||||
} else if (fontFamily) {
|
||||
var content = styles.getPropertyValue('content');
|
||||
var prefix = ~['Light', 'Regular', 'Solid', 'Brands'].indexOf(fontFamily[1]) ? STYLE_TO_PREFIX[fontFamily[1].toLowerCase()] : FONT_WEIGHT_TO_PREFIX[fontWeight];
|
||||
var iconName = byUnicode(prefix, toHex(content.length === 3 ? content.substr(1, 1) : content)); // Only convert the pseudo element in this :before/:after position into an icon if we haven't
|
||||
var hexValue = toHex(content.length === 3 ? content.substr(1, 1) : content);
|
||||
var iconName = byUnicode(prefix, hexValue);
|
||||
var iconIdentifier = iconName; // Only convert the pseudo element in this :before/:after position into an icon if we haven't
|
||||
// already done so with the same prefix and iconName
|
||||
|
||||
if (!alreadyProcessedPseudoElement || alreadyProcessedPseudoElement.getAttribute(DATA_PREFIX) !== prefix || alreadyProcessedPseudoElement.getAttribute(DATA_ICON) !== iconName) {
|
||||
node.setAttribute(pendingAttribute, iconName);
|
||||
if (iconName && (!alreadyProcessedPseudoElement || alreadyProcessedPseudoElement.getAttribute(DATA_PREFIX) !== prefix || alreadyProcessedPseudoElement.getAttribute(DATA_ICON) !== iconIdentifier)) {
|
||||
node.setAttribute(pendingAttribute, iconIdentifier);
|
||||
|
||||
if (alreadyProcessedPseudoElement) {
|
||||
// Delete the old one, since we're replacing it with a new one
|
||||
@@ -1936,7 +1943,7 @@
|
||||
mask: emptyCanonicalIcon()
|
||||
},
|
||||
prefix: prefix,
|
||||
iconName: iconName,
|
||||
iconName: iconIdentifier,
|
||||
extra: extra,
|
||||
watchable: true
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user