Hot answers tagged

3

Any specific comments on my use of computed? I understand it's an annoying thing to have to repeat the dependencies for computed function but that's how Polymer can infer when that property has to be refreshed. If you had to use only the function name then it had to analyze your JavaScript code and it's an definitely a complex/slow task (it can't simply ...


2

Search online for "queryselectorall vs getelementsbytagname" and you will likely see results like this SO post from August 2013 and this post from September 2010. After reading those one can posit that using Element.getElementsByTagName() instead of querySelectorAll() would be quicker, since the selector appears to merely find elements by tag name. Be aware ...


1

Since the only difference between the two examples is the href attribute we see in DevDocs that: Elements in HTML have attributes; these are additional values that configure the elements or adjust their behavior in various ways to meet the criteria the users want. In the documentation, the only elements that receive the href attribute are: <a>, <...


1

Just wanted to let you know that function getNodeIndex(node) { var index = -1; while ((node = node.previousSibling)) { if (node.nodeType != 3 || !/^\s*$/.test(node.data)) { index++; } } return index; } Could be function getNodeIndex(node) { return Array.prototype.indexOf.call(e.childNodes, someChildEl); } ...


Only top voted, non community-wiki answers of a minimum length are eligible