Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: composer.postload.js

Issue 29371763: Issue 4795 - Use modern JavaScript syntax (Closed)
Patch Set: Workaround limiation with iterating element collections in older versions of Chrome Created Jan. 16, 2017, 8:46 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « composer.js ('k') | ext/background.js » ('j') | lib/notificationHelper.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: composer.postload.js
diff --git a/composer.postload.js b/composer.postload.js
index 98fef095aa636d2c8753329fc41d64234e6f839e..01f01788b1843dea0539f56e0c617fecf3f9860e 100644
--- a/composer.postload.js
+++ b/composer.postload.js
@@ -80,14 +80,14 @@ function getBlockableElementOrAncestor(element, callback)
let images = document.querySelectorAll("img[usemap]");
let image = null;
- for (let i = 0; i < images.length; i++)
+ for (let currentImage of images)
{
- let usemap = images[i].getAttribute("usemap");
+ let usemap = currentImage.getAttribute("usemap");
let index = usemap.indexOf("#");
if (index != -1 && usemap.substr(index + 1) == element.name)
{
- image = images[i];
+ image = currentImage;
break;
}
}
@@ -165,7 +165,7 @@ function highlightElement(element, shadowColor, backgroundColor)
{
unhighlightElement(element);
- let highlightWithOverlay = function()
+ let highlightWithOverlay = () =>
{
let overlay = addElementOverlay(element);
@@ -183,7 +183,7 @@ function highlightElement(element, shadowColor, backgroundColor)
};
};
- let highlightWithStyleAttribute = function()
+ let highlightWithStyleAttribute = () =>
{
let originalBoxShadow = element.style.getPropertyValue("box-shadow");
let originalBoxShadowPriority =
« no previous file with comments | « composer.js ('k') | ext/background.js » ('j') | lib/notificationHelper.js » ('J')

Powered by Google App Engine
This is Rietveld