From 97cbfbd5f07d0cee0bc978039b31bf2c9bb5e22b Mon Sep 17 00:00:00 2001 From: Tooru Fujisawa Date: Fri, 10 Apr 2015 00:14:25 +0900 Subject: [PATCH] Bug 1151474 - Part 4: Remove use of expression closure from im/themes/. r=florian --- im/themes/messages/bubbles/Footer.html | 7 ++++--- im/themes/messages/papersheets/Footer.html | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/im/themes/messages/bubbles/Footer.html b/im/themes/messages/bubbles/Footer.html index 222697138c..c4c6f15a73 100644 --- a/im/themes/messages/bubbles/Footer.html +++ b/im/themes/messages/bubbles/Footer.html @@ -80,8 +80,9 @@ const kMsPerMinute = 60 * 1000; const kMsPerHour = 60 * kMsPerMinute; const kMsPerDay = 24 * kMsPerHour; -function computeSpace(aInterval) - Math.round(coef * Math.log(aInterval + 1)) +function computeSpace(aInterval) { + return Math.round(coef * Math.log(aInterval + 1)); +} var lastMessageTimeout; var lastMessageTimeoutTime = -1; @@ -238,7 +239,7 @@ function checkNewText(target) if (!parent.grouped && parent.querySelector("p.event:nth-of-type(4)")) { var p = document.createElement("p"); p.className = "eventToggle"; - p.addEventListener("click", function (event) + p.addEventListener("click", event => event.target.parentNode.classList.toggle("hide-children")); parent.insertBefore(p, parent.querySelector("p.event:nth-of-type(2)")); parent.classList.add("hide-children"); diff --git a/im/themes/messages/papersheets/Footer.html b/im/themes/messages/papersheets/Footer.html index 24bb7f53cf..fda7c7429b 100644 --- a/im/themes/messages/papersheets/Footer.html +++ b/im/themes/messages/papersheets/Footer.html @@ -59,7 +59,7 @@ function checkNewText(target) if (!parent.grouped && parent.querySelector("p.event:nth-of-type(3)")) { var div = document.createElement("div"); div.className = "eventToggle"; - div.addEventListener("click", function (event) + div.addEventListener("click", event => event.target.parentNode.classList.toggle("hide-children")); parent.insertBefore(div, parent.querySelector("p.event:first-of-type")); parent.classList.add("hide-children");