Bug 1383886 - Remove redundant element.closest() call since one call to closest() can do the work that was previously done by two calls to closest() and a property check. r?gijs
MozReview-Commit-ID: L6weawO4qB0
--- a/browser/extensions/pocket/content/main.js
+++ b/browser/extensions/pocket/content/main.js
@@ -92,18 +92,17 @@ var pktUI = (function() {
getPanelFrame().setAttribute("src", "about:blank");
if (_lastAddSucceeded) {
var libraryButton = document.getElementById("library-button");
if (!Services.prefs.getBoolPref("toolkit.cosmeticAnimations.enabled") ||
!libraryButton ||
libraryButton.getAttribute("cui-areatype") == "menu-panel" ||
libraryButton.getAttribute("overflowedItem") == "true" ||
- !libraryButton.closest("toolbar") ||
- libraryButton.closest("toolbar").id != "nav-bar") {
+ !libraryButton.closest("#nav-bar")) {
return;
}
libraryButton.removeAttribute("fade");
libraryButton.setAttribute("animate", "pocket");
libraryButton.addEventListener("animationend", onLibraryButtonAnimationEnd);
}
}