Closed AngKov closed 6 years ago
found what was wrong. need to change children to ChildNode
function getLastChild(elem) { if (!elem.lastChild) { return; } //Current element has children, need to go deeper and get last child as a text node if (elem.lastChild.childNodes && elem.lastChild.childNodes.length > 0) { return getLastChild(Array.prototype.slice.call(elem.childNodes).pop()); } //This is the absolute last child, a text node, but something's wrong with it. Remove it and keep trying else if (!elem.lastChild || !elem.lastChild.nodeValue || elem.lastChild.nodeValue === '' || elem.lastChild.nodeValue == opt.truncationChar) { elem.lastChild.parentNode.removeChild(elem.lastChild); return getLastChild(element); } //This is the last child we want, return it else { return elem.lastChild; } }
Fixed by f00ba8701e42212b0e3ff568a55e547944275e3c
I'm having an issue with clamping in IE to 2 lines only. Have the same function with 3 line, and it works perfectly, and it clamps the full component to ellipsis if $clamp(element, { clamp: 2});
Would appreciate any suggestions