From ada558174214bb5e218f386864f1e106505efdfd Mon Sep 17 00:00:00 2001 From: "radha%netscape.com" Date: Fri, 23 Apr 1999 23:07:11 +0000 Subject: [PATCH] Code to enable/disable forward/back menu items. Though it is n't quite functional --- xpfe/browser/src/navigator.xul | 43 ++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/xpfe/browser/src/navigator.xul b/xpfe/browser/src/navigator.xul index 4fca75d007a..0714a7264c6 100644 --- a/xpfe/browser/src/navigator.xul +++ b/xpfe/browser/src/navigator.xul @@ -117,14 +117,31 @@ } // Enable/Disable the Forward menu - + var fm = document.getElementById("menuitem-forward"); + if (!fm) { + dump("Couldn't obtain menu item Forward\n"); + return; + } + else + dump("Got a handle to forward menu item\n"); + + // Enable/Disable the Forward Menuitem + if (canForward == "true") { + dump("Setting forward menu item disabled\n"); + fm.setAttribute("disabled", "true"); + } + else { + dump("Setting forward menu item enabled\n"); + fm.setAttribute("disabled", ""); + } + } function BrowserSetBack() { var backBElem = document.getElementById("canGoBack"); if (!backBElem) { - dump("Couldn't obtain handle to back Broarcast element\n"); + dump("Couldn't obtain handle to back Broadcast element\n"); return; } @@ -145,6 +162,24 @@ } // Enable/Disable the Back menu + var bm = document.getElementById("menuitem-back"); + if (!bm) { + dump("Couldn't obtain menu item Back\n"); + return; + } + else + dump("Obtained MenuItem Back\n"); + + // Enable/Disable the Back Menuitem + if (canBack == "true") { + dump("Setting Back menuitem to disabled\n"); + bm.setAttribute("disabled", "true"); + } + else { + dump("Setting Back menuitem to enabled\n"); + bm.setAttribute("disabled", ""); + } + } @@ -623,8 +658,8 @@ - - + +