From ce9964ff8f9d8a801b00f9552df6000ee066d04f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A3o=20Gottwald?= Date: Sun, 12 Jul 2009 15:44:33 +0200 Subject: [PATCH] whitespace cleanup --- browser/base/content/browser.js | 44 +++++++++++---------------------- 1 file changed, 14 insertions(+), 30 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index e12672d775ef..31347996b654 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -198,14 +198,12 @@ function UpdateBackForwardCommands(aWebNavigation) { * Click-and-Hold implementation for the Back and Forward buttons * XXXmano: should this live in toolbarbutton.xml? */ -function ClickAndHoldMouseDownCallback(aButton) -{ +function ClickAndHoldMouseDownCallback(aButton) { aButton.open = true; gClickAndHoldTimer = null; } -function ClickAndHoldMouseDown(aEvent) -{ +function ClickAndHoldMouseDown(aEvent) { /** * 1. Only left click starts the click and hold timer. * 2. Exclude the dropmarker area. This is done by excluding @@ -223,49 +221,35 @@ function ClickAndHoldMouseDown(aEvent) setTimeout(ClickAndHoldMouseDownCallback, 500, aEvent.currentTarget); } -function MayStopClickAndHoldTimer(aEvent) -{ +function MayStopClickAndHoldTimer(aEvent) { // Note passing null here is a no-op clearTimeout(gClickAndHoldTimer); } -function ClickAndHoldStopEvent(aEvent) -{ +function ClickAndHoldStopEvent(aEvent) { if (aEvent.originalTarget.localName != "menuitem" && aEvent.currentTarget.open) aEvent.stopPropagation(); } -function SetClickAndHoldHandlers() -{ - function _addClickAndHoldListenersOnElement(aElm) - { - aElm.addEventListener("mousedown", - ClickAndHoldMouseDown, - false); - aElm.addEventListener("mouseup", - MayStopClickAndHoldTimer, - false); - aElm.addEventListener("mouseout", - MayStopClickAndHoldTimer, - false); - +function SetClickAndHoldHandlers() { + function _addClickAndHoldListenersOnElement(aElm) { + aElm.addEventListener("mousedown", ClickAndHoldMouseDown, false); + aElm.addEventListener("mouseup", MayStopClickAndHoldTimer, false); + aElm.addEventListener("mouseout", MayStopClickAndHoldTimer, false); + // don't propagate onclick and oncommand events after // click-and-hold opened the drop-down menu - aElm.addEventListener("command", - ClickAndHoldStopEvent, - true); - aElm.addEventListener("click", - ClickAndHoldStopEvent, - true); + aElm.addEventListener("command", ClickAndHoldStopEvent, true); + aElm.addEventListener("click", ClickAndHoldStopEvent, true); } // Bug 414797: Clone the dropmarker's menu into both the back and // the forward buttons. var unifiedButton = document.getElementById("unified-back-forward-button"); - if (unifiedButton && !unifiedButton._clickHandlersAttached) { + if (unifiedButton && !unifiedButton._clickHandlersAttached) { var popup = document.getElementById("back-forward-dropmarker") - .firstChild.cloneNode(true); + .firstChild.cloneNode(true); var backButton = document.getElementById("back-button"); backButton.setAttribute("type", "menu-button"); backButton.appendChild(popup);