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

Unified Diff: lib/ui.js

Issue 6341149593698304: Issue 301 - Change for each to for .. of .. in lib/ (Closed)
Patch Set: Created April 10, 2014, 5:02 p.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 | « lib/synchronizer.js ('k') | lib/utils.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/ui.js
===================================================================
--- a/lib/ui.js
+++ b/lib/ui.js
@@ -891,17 +891,17 @@ let UI = exports.UI =
if (!match)
return;
// Decode URL parameters
let title = null;
let url = null;
let mainSubscriptionTitle = null;
let mainSubscriptionURL = null;
- for each (let param in match[1].split('&'))
+ for (let param of match[1].split('&'))
{
let parts = param.split("=", 2);
if (parts.length != 2 || !/\S/.test(parts[1]))
continue;
switch (parts[0])
{
case "title":
title = decodeURIComponent(parts[1]);
@@ -1318,17 +1318,17 @@ let UI = exports.UI =
let node = window.document.tooltipNode;
if (!node || !node.hasAttribute("tooltip"))
{
event.preventDefault();
return;
}
// Prevent tooltip from overlapping menu
- for each (let id in ["abp-toolbar-popup", "abp-status-popup"])
+ for (let id of ["abp-toolbar-popup", "abp-status-popup"])
{
let element = E(id);
if (element && element.state == "open")
{
event.preventDefault();
return;
}
}
@@ -1786,17 +1786,17 @@ let UI = exports.UI =
/**
* Hide contribute button and persist this choice.
*/
hideContributeButton: function(/**Window*/ window)
{
Prefs.hideContributeButton = true;
- for each (let id in ["abp-status-contributebutton", "abp-toolbar-contributebutton", "abp-menuitem-contributebutton"])
+ for (let id of ["abp-status-contributebutton", "abp-toolbar-contributebutton", "abp-menuitem-contributebutton"])
{
let button = window.document.getElementById(id);
if (button)
button.hidden = true;
}
},
showNextNotification: function(url)
@@ -1846,17 +1846,17 @@ let UI = exports.UI =
}
let texts = Notification.getLocalizedTexts(notification);
let titleElement = window.document.getElementById("abp-notification-title");
titleElement.textContent = texts.title;
let messageElement = window.document.getElementById("abp-notification-message");
messageElement.innerHTML = "";
let docLinks = [];
- for each (let link in notification.links)
+ for (let link of notification.links)
docLinks.push(Utils.getDocLink(link));
insertMessage(messageElement, texts.message, docLinks);
messageElement.addEventListener("click", function(event)
{
let link = event.target;
while (link && link !== messageElement && link.localName !== "a")
link = link.parentNode;
« no previous file with comments | « lib/synchronizer.js ('k') | lib/utils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld