From 4f92c97939392bbbb43fdbd554b39bfc804f90db Mon Sep 17 00:00:00 2001 From: "philringnalda@gmail.com" Date: Wed, 13 Jun 2007 22:26:39 -0700 Subject: [PATCH] Bug 379011 - Text size increasing/decreasing broken in view source window, patch by Jason Barnabe , r=gavin --- toolkit/components/help/content/help.js | 4 ---- toolkit/content/viewZoomOverlay.js | 12 ++++++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/toolkit/components/help/content/help.js b/toolkit/components/help/content/help.js index c7fa4505162..295cd8392c7 100644 --- a/toolkit/components/help/content/help.js +++ b/toolkit/components/help/content/help.js @@ -584,10 +584,6 @@ function UpdateBackForwardButtons() { } } -function getMarkupDocumentViewer() { - return helpBrowser.markupDocumentViewer; -} - function onselect_loadURI(tree) { try { var resource = tree.view.getResourceAtIndex(tree.currentIndex); diff --git a/toolkit/content/viewZoomOverlay.js b/toolkit/content/viewZoomOverlay.js index 6aa31ea098c..b85ed62bd29 100644 --- a/toolkit/content/viewZoomOverlay.js +++ b/toolkit/content/viewZoomOverlay.js @@ -23,6 +23,7 @@ # Contributor(s): # Peter Annema (Original Author) # Jonas Sicking +# Jason Barnabe # # Alternatively, the contents of this file may be used under the terms of # either the GNU General Public License Version 2 or later (the "GPL"), or @@ -40,8 +41,7 @@ /** Document Zoom Management Code * - * To use this, you'll need to have a getMarkupDocumentViewer() function which returns a - * nsIMarkupDocumentViewer. + * To use this, you'll need to have a getBrowser() function. * **/ @@ -69,7 +69,7 @@ ZoomManager.prototype = { get textZoom() { var currentZoom; try { - currentZoom = Math.round(getMarkupDocumentViewer().textZoom * 100); + currentZoom = Math.round(this.markupDocumentViewer.textZoom * 100); if (this.indexOf(currentZoom) == -1) { if (currentZoom != this.factorOther) { this.factorOther = currentZoom; @@ -86,7 +86,7 @@ ZoomManager.prototype = { if (aZoom < this.MIN || aZoom > this.MAX) throw Components.results.NS_ERROR_INVALID_ARG; - getMarkupDocumentViewer().textZoom = aZoom / 100; + this.markupDocumentViewer.textZoom = aZoom / 100; }, enlarge : function() { @@ -183,6 +183,10 @@ ZoomManager.prototype = { } return aZoom; + }, + + get markupDocumentViewer() { + return getBrowser().markupDocumentViewer; } }