Bug 99501: JS error in viewZoomOverlay.js at startup. r=sfraser, sr=hewitt

This commit is contained in:
jaggernaut%netscape.com 2001-12-01 00:43:22 +00:00
Родитель cd9bf30f7f
Коммит b66ae518a2
4 изменённых файлов: 36 добавлений и 34 удалений

Просмотреть файл

@ -1165,8 +1165,8 @@ function hiddenWindowStartup()
// Disable menus which are not appropriate
var disabledItems = ['cmd_close', 'Browser:SendPage', 'Browser:EditPage', 'Browser:PrintSetup', /*'Browser:PrintPreview',*/
'Browser:Print', 'canGoBack', 'canGoForward', 'Browser:Home', 'Browser:AddBookmark', 'cmd_undo',
'cmd_redo', 'cmd_cut', 'cmd_copy','cmd_paste', 'cmd_delete', 'cmd_selectAll'];
for (id in disabledItems) {
'cmd_redo', 'cmd_cut', 'cmd_copy','cmd_paste', 'cmd_delete', 'cmd_selectAll', 'menu_textZoom'];
for (var id in disabledItems) {
var broadcaster = document.getElementById(disabledItems[id]);
if (broadcaster)
broadcaster.setAttribute("disabled", "true");

Просмотреть файл

@ -73,13 +73,18 @@ ZoomManager.prototype = {
steps : 0,
get textZoom() {
var currentZoom = Math.round(getMarkupDocumentViewer().textZoom * 100);
var currentZoom;
try {
currentZoom = Math.round(getMarkupDocumentViewer().textZoom * 100);
if (this.indexOf(currentZoom) == -1) {
if (currentZoom != this.factorOther) {
this.factorOther = currentZoom;
this.factorAnchor = this.factorOther;
}
}
} catch (e) {
currentZoom = 100;
}
return currentZoom;
},
@ -214,17 +219,13 @@ ZoomManager.prototype = {
}
/***** init and helper functions for viewZoomOverlay.xul *****/
window.addEventListener("load", registerZoomManager, false);
function registerZoomManager()
{
var textZoomMenu = document.getElementById("menu_textZoom");
if (textZoomMenu) {
var zoom = ZoomManager.prototype.getInstance();
textZoomMenu.removeAttribute("hidden");
var parentMenu = textZoomMenu.parentNode;
parentMenu.addEventListener("popupshowing", updateViewMenu, false);
@ -249,7 +250,6 @@ function registerZoomManager()
menuItem.setAttribute("value", zoomFactors[i]);
popup.insertBefore(menuItem, insertBefore);
}
}
}
function updateViewMenu()

Просмотреть файл

@ -58,7 +58,7 @@
<command id="cmd_textZoomReset" oncommand="ZoomManager.prototype.getInstance().reset();"/>
</commandset>
<menu id="menu_textZoom" accesskey="&textZoomMenu.accesskey;" hidden="true">
<menu id="menu_textZoom" accesskey="&textZoomMenu.accesskey;">
<menupopup id="menu_textZoomPopup" onpopupshowing="updateTextZoomMenu();">
<menuitem key="key_textZoomReduce" label="&textZoomReduceCmd.label;" accesskey="&textZoomReduceCmd.accesskey;" command="cmd_textZoomReduce"/>
<menuitem key="key_textZoomEnlarge" label="&textZoomEnlargeCmd.label;" accesskey="&textZoomEnlargeCmd.accesskey;" command="cmd_textZoomEnlarge"/>

Просмотреть файл

@ -55,6 +55,8 @@ Contributor(s): ______________________________________. -->
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://navigator/content/navigator.js"/>
<stringbundleset id="stringbundleset"/>
<!-- keys are appended from the overlay -->
<keyset id="tasksKeys"/>
<keyset id="navKeys">