Bug 1135720 - hide non-working folder and chat operations menu items in the standalone message window. r=mkmelin, r=Florian, a=rkent
authoraceman <acelists@atlas.sk>
Wed, 25 Mar 2015 21:31:36 -0700
changeset 25824 d6ae5fb08f51e871286e4b0175cbb3cfd93fbe44
parent 25823 9d679df1db123964d4afbb617ddc737862adfcf6
child 25825 c91007a6f7b307114ab27cae89f93b5759577afb
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin, Florian, rkent
bugs1135720
Bug 1135720 - hide non-working folder and chat operations menu items in the standalone message window. r=mkmelin, r=Florian, a=rkent
mail/base/content/mail3PaneWindowCommands.js
mail/base/content/mailWindowOverlay.js
mail/base/content/mailWindowOverlay.xul
mail/base/content/messageWindow.js
--- a/mail/base/content/mail3PaneWindowCommands.js
+++ b/mail/base/content/mail3PaneWindowCommands.js
@@ -245,29 +245,34 @@ var DefaultController =
       case "cmd_watchThread":
       case "cmd_killThread":
       case "cmd_killSubthread":
         return true;
       case "cmd_downloadFlagged":
       case "cmd_downloadSelected":
       case "cmd_synchronizeOffline":
         return MailOfflineMgr.isOnline();
+      case "cmd_newFolder":
+      case "cmd_newVirtualFolder":
+        return !!gFolderTreeController;
+      case "cmd_goFolder":
+        return !!gFolderTreeView;
+      case "cmd_joinChat":
+      case "cmd_addChatBuddy":
+      case "cmd_chatStatus":
+        return !!chatHandler;
 
       default:
         return false;
     }
   },
 
   isCommandEnabled: function(command)
   {
-    var enabled = new Object();
-    enabled.value = false;
-    var checkStatus = new Object();
-
-    switch ( command )
+    switch (command)
     {
       case "cmd_delete":
         UpdateDeleteCommand();
         // fall through
       case "button_delete":
         UpdateDeleteToolbarButton();
         return gFolderDisplay.getCommandStatus(nsMsgViewCommandType.deleteMsg);
       case "cmd_shiftDelete":
@@ -424,18 +429,18 @@ var DefaultController =
       case "button_previous":
       case "cmd_previousUnreadMsg":
         return IsViewNavigationItemEnabled();
       case "button_goForward":
       case "button_goBack":
       case "cmd_goForward":
       case "cmd_goBack":
         if (gDBView)
-          enabled.value = gDBView.navigateStatus((command == "cmd_goBack" || command == "button_goBack") ? nsMsgNavigationType.back : nsMsgNavigationType.forward);
-        return enabled.value;
+          return gDBView.navigateStatus((command == "cmd_goBack" || command == "button_goBack") ? nsMsgNavigationType.back : nsMsgNavigationType.forward);
+        return false;
       case "cmd_goStartPage":
         return document.getElementById("tabmail").selectedTab.mode.name == "folder" &&
                !IsMessagePaneCollapsed();
       case "cmd_undoCloseTab":
         return (document.getElementById("tabmail").recentlyClosedTabs.length > 0);
       case "cmd_markAllRead":
         return IsFolderSelected() && gDBView &&
                gDBView.msgFolder.getNumUnread(false) > 0;
@@ -561,27 +566,38 @@ var DefaultController =
       case "cmd_fullZoomToggle":
         // If we are a message tab, then we've got a message displayed, so
         // always allow zooming in the message
         if (document.getElementById("tabmail").selectedTab.mode.name == "message")
           return true;
         return IsFolderSelected() && !IsMessagePaneCollapsed();
       case "cmd_chat":
         return true;
+      case "cmd_newFolder":
+      case "cmd_newVirtualFolder":
+        return !!gFolderTreeController;
+      case "cmd_goFolder":
+        return !!gFolderTreeView;
+      case "cmd_joinChat":
+      case "cmd_addChatBuddy":
+      case "cmd_chatStatus":
+        return !!chatHandler;
+
       default:
         return false;
     }
     return false;
   },
 
   doCommand: function(command, aTab)
   {
-    // if the user invoked a key short cut then it is possible that we got here for a command which is
-    // really disabled. kick out if the command should be disabled.
-    if (!this.isCommandEnabled(command)) return;
+    // If the user invoked a key short cut then it is possible that we got here
+    // for a command which is really disabled. Kick out if the command should be disabled.
+    if (!this.isCommandEnabled(command))
+      return;
 
     switch ( command )
     {
       case "button_getNewMessages":
       case "cmd_getNewMessages":
         MsgGetMessage();
         break;
       case "cmd_getMsgsForAuthAccounts":
@@ -963,16 +979,28 @@ var DefaultController =
         ZoomManager.reset();
         break;
       case "cmd_fullZoomToggle":
         ZoomManager.toggleZoom();
         break;
       case "cmd_chat":
         showChatTab();
         break;
+      case "cmd_newFolder":
+        gFolderTreeController.newFolder();
+        break;
+      case "cmd_newVirtualFolder":
+        gFolderTreeController.newVirtualFolder();
+        break;
+      case "cmd_joinChat":
+        chatHandler.joinChat();
+        break;
+      case "cmd_addChatBuddy":
+        chatHandler.addBuddy();
+        break;
     }
   },
 
   onEvent: function(event)
   {
     // on blur events set the menu item texts back to the normal values
     if ( event == 'blur' )
     {
--- a/mail/base/content/mailWindowOverlay.js
+++ b/mail/base/content/mailWindowOverlay.js
@@ -60,18 +60,19 @@ function menu_new_init()
   if (!folder)
     return;
 
   if (Services.prefs.prefIsLocked("mail.disable_new_account_addition"))
     document.getElementById("newAccountMenuItem").setAttribute("disabled", "true");
 
   const nsMsgFolderFlags = Components.interfaces.nsMsgFolderFlags;
   var isInbox = folder.isSpecialFolder(nsMsgFolderFlags.Inbox);
-  var showNew = folder.canCreateSubfolders ||
-                (isInbox && !(folder.flags & nsMsgFolderFlags.Virtual));
+  var showNew = (folder.canCreateSubfolders ||
+                 (isInbox && !(folder.flags & nsMsgFolderFlags.Virtual))) &&
+                (document.getElementById("cmd_newFolder").getAttribute("disabled") != "true");
   ShowMenuItem("menu_newFolder", showNew);
   ShowMenuItem("menu_newVirtualFolder", showNew);
 
   EnableMenuItem("menu_newFolder", folder.server.type != "imap" || MailOfflineMgr.isOnline());
   if (showNew)
   {
     var bundle = document.getElementById("bundle_messenger");
     // Change "New Folder..." menu according to the context.
--- a/mail/base/content/mailWindowOverlay.xul
+++ b/mail/base/content/mailWindowOverlay.xul
@@ -84,16 +84,18 @@
 
 <!-- End command set merging -->
 
 <commandset id="mailFileMenuItems"
             commandupdater="true"
             events="create-menu-file"
             oncommandupdate="goUpdateMailMenuItems(this)">
 
+    <command id="cmd_newFolder" oncommand="goDoCommand('cmd_newFolder')" disabled="true"/>
+    <command id="cmd_newVirtualFolder" oncommand="goDoCommand('cmd_newVirtualFolder')" disabled="true"/>
     <command id="cmd_getNewMessages" oncommand="goDoCommand('cmd_getNewMessages')" disabled="true"/>
     <command id="cmd_open" oncommand="goDoCommand('cmd_open')"/>
 
     <command id="cmd_emptyTrash" oncommand="goDoCommand('cmd_emptyTrash')" disabled="true"/>
     <command id="cmd_compactFolder" oncommand="goDoCommand('cmd_compactFolder')" disabled="true"/>
     <command id="cmd_printSetup" oncommand="goDoCommand('cmd_printSetup')" disabled="true"/>
     <command id="cmd_print" oncommand="goDoCommand('cmd_print')" disabled="true"/>
     <command id="cmd_printpreview" oncommand="goDoCommand('cmd_printpreview')" disabled="true"/>
@@ -221,16 +223,17 @@
   <command id="cmd_nextUnreadThread" oncommand="goDoCommand('cmd_nextUnreadThread')" disabled="true"/>
   <command id="cmd_previousMsg" oncommand="goDoCommand('cmd_previousMsg')" disabled="true"/>
   <command id="cmd_previousUnreadMsg" oncommand="goDoCommand('cmd_previousUnreadMsg')" disabled="true"/>
   <command id="cmd_previousFlaggedMsg" oncommand="goDoCommand('cmd_previousFlaggedMsg')" disabled="true"/>
   <command id="cmd_goStartPage" oncommand="goDoCommand('cmd_goStartPage');"/>
   <command id="cmd_undoCloseTab" oncommand="goDoCommand('cmd_undoCloseTab');"/>
   <command id="cmd_goForward" oncommand="goDoCommand('cmd_goForward')" disabled="true"/>
   <command id="cmd_goBack" oncommand="goDoCommand('cmd_goBack')" disabled="true"/>
+  <command id="cmd_goFolder" oncommand="gFolderTreeView.selectFolder(event.target._folder, true);" disabled="true"/>
   <command id="cmd_chat" oncommand="goDoCommand('cmd_chat')" disabled="true"/>
 </commandset>
 
 <commandset id="mailMessageMenuItems"
             commandupdater="true"
             events="create-menu-message"
             oncommandupdate="goUpdateMailMenuItems(this)">
   <command id="cmd_archive" oncommand="goDoCommand('cmd_archive')"/>
@@ -331,16 +334,19 @@
            oncommand="goDoCommand('cmd_applyFiltersToSelection');"
            disabled="true"
            valueSelection="&filtersApplyToSelection.label;"
            valueSelectionAccessKey="&filtersApplyToSelection.accesskey;"
            valueMessage="&filtersApplyToMessage.label;"
            valueMessageAccessKey="&filtersApplyToMessage.accesskey;"/>
   <command id="cmd_runJunkControls" oncommand="goDoCommand('cmd_runJunkControls');" disabled="true"/>
   <command id="cmd_deleteJunk" oncommand="goDoCommand('cmd_deleteJunk');" disabled="true"/>
+  <command id="cmd_joinChat" oncommand="goDoCommand('cmd_joinChat');" disabled="true"/>
+  <command id="cmd_chatStatus" oncommand="chatHandler.setStatusMenupopupCommand(event);" disabled="true"/>
+  <command id="cmd_addChatBuddy" oncommand="goDoCommand('cmd_addChatBuddy');" disabled="true"/>
 </commandset>
 
 #ifdef XP_MACOSX
 <commandset id="macWindowMenuItems">
   <!-- Mac Window menu -->
   <command id="minimizeWindow" label="&minimizeWindow.label;" oncommand="window.minimize();"/>
   <command id="zoomWindow" label="&zoomWindow.label;" oncommand="zoomWindow();"/>
   <command id="Tasks:Mail" oncommand="focusOnMail(1);"/>
@@ -1036,20 +1042,20 @@
                    command="cmd_newMessage">
             <menupopup id="appmenu_newMenupopup">
               <menuitem id="appmenu_newNewMsgCmd"
                         label="&newNewMsgCmd.label;"
                         key="key_newMessage2"
                         command="cmd_newMessage"/>
               <menuitem id="appmenu_newFolder"
                         label="&newFolderCmd.label;"
-                        oncommand="gFolderTreeController.newFolder();"/>
+                        command="cmd_newFolder"/>
               <menuitem id="appmenu_newVirtualFolder"
                         label="&newVirtualFolderCmd.label;"
-                        oncommand="gFolderTreeController.newVirtualFolder();"/>
+                        command="cmd_newVirtualFolder"/>
               <menuseparator id="appmenu_newAccountPopupMenuSeparator"/>
               <menuitem id="appmenu_newCreateEmailAccountMenuItem"
                         label="&newCreateEmailAccountCmd.label;"
                         oncommand="NewMailAccountProvisioner(msgWindow);"/>
               <menuitem id="appmenu_newMailAccountMenuItem"
                         label="&newExistingEmailAccountCmd.label;"
                         oncommand="NewMailAccount(msgWindow);"/>
               <menuitem id="appmenu_newIMAccountMenuItem"
@@ -1063,17 +1069,17 @@
                         label="&newOtherAccountsCmd.label;"
                         oncommand="MsgAccountWizard();"/>
               <menuseparator id="appmenu_newPopupMenuSeparator"/>
               <menuitem id="appmenu_newCard"
                         label="&appmenuNewContactCmd.label;"
                         command="cmd_newCard"/>
               <menuitem id="appmenu_newIMContactMenuItem"
                         label="&newIMContactCmd.label;"
-                        oncommand="chatHandler.addBuddy();"/>
+                        command="cmd_addChatBuddy"/>
             </menupopup>
         </splitmenu>
         <menu id="appmenu_msgAttachmentMenu"
               label="&openAttachmentListCmd.label;"
               disabled="true">
           <menupopup id="appmenu_attachmentMenuList"
                      onpopupshowing="FillAttachmentListPopup(this);"/>
         </menu>
@@ -1809,17 +1815,17 @@
             <menuseparator id="appmenu_goNextSeparator"/>
             <menuitem id="appmenu_goChat"
                       label="&goChatCmd.label;"
                       key="key_goChat"
                       command="cmd_chat"/>
             <menuseparator id="appmenu_goChatSeparator"/>
             <menu id="appmenu_goFolderMenu"
                   label="&folderMenu.label;"
-                  oncommand="gFolderTreeView.selectFolder(event.target._folder, true)">
+                  command="cmd_goFolder">
               <menupopup id="appmenu_GoFolderPopup"
                          type="folder"
                          showFileHereLabel="true"
                          showRecent="true"
                          recentLabel="&contextMoveCopyMsgRecentMenu.label;"/>
             </menu>
             <menuseparator id="appmenu_goFolderSeparator"/>
             <menu id="appmenu_goRecentlyClosedTabs"
@@ -2039,17 +2045,17 @@
                       oncommand="toOpenWindowByType('mail:addressbook', 'chrome://messenger/content/addressbook/addressbook.xul');"/>
             <menuseparator id="devToolsSeparator"/>
             <menuitem id="appmenu_openSavedFilesWnd"
                       label="&savedFiles.label;"
                       key="key_savedFiles"
                       oncommand="openSavedFilesWnd();"/>
             <menu id="appmenu_imAccountsStatus"
                   label="&imAccountsStatus.label;"
-                  oncommand="chatHandler.setStatusMenupopupCommand(event);">
+                  command="cmd_chatStatus">
               <menupopup id="appmenu_imStatusMenupopup">
                 <menuitem id="appmenu_imStatusAvailable"
                           status="available"
                           label="&imStatus.available;"
                           class="menuitem-iconic"/>
                 <menuitem id="appmenu_imStatusUnavailable"
                           status="unavailable"
                           label="&imStatus.unavailable;"
@@ -2061,17 +2067,17 @@
                           class="menuitem-iconic"/>
                 <menuseparator id="appmenu_imStatusShowAccountsSeparator"/>
                 <menuitem id="appmenu_imStatusShowAccounts"
                           label="&imStatus.showAccounts;"/>
               </menupopup>
             </menu>
             <menuitem id="appmenu_joinChatMenuItem"
                       label="&joinChatCmd.label;"
-                      oncommand="chatHandler.joinChat();"/>
+                      command="cmd_joinChat"/>
             <menuseparator id="appmenu_afterChatSeparator"/>
             <menuitem id="appmenu_runJunkControls"
                       label="&runJunkControls.label;"
                       command="cmd_runJunkControls"/>
             <menuitem id="appmenu_deleteJunk"
                       label="&deleteJunk.label;"
                       command="cmd_deleteJunk"/>
             <menuseparator id="tasksMenuAfterDeleteSeparator"/>
@@ -2156,21 +2162,21 @@
           <menupopup id="menu_FilePopup" onpopupshowing="file_init();">
           <menu id="menu_New">
             <menupopup id="menu_NewPopup" onpopupshowing="menu_new_init();">
               <menuitem id="menu_newNewMsgCmd" label="&newNewMsgCmd.label;"
                         accesskey="&newNewMsgCmd.accesskey;"
                         key="key_newMessage2"
                         command="cmd_newMessage"/>
               <menuitem id="menu_newFolder" label="&newFolderCmd.label;"
-                         oncommand="gFolderTreeController.newFolder();"
-                         accesskey="&newFolderCmd.accesskey;"/>
+                        command="cmd_newFolder"
+                        accesskey="&newFolderCmd.accesskey;"/>
               <menuitem id="menu_newVirtualFolder" label="&newVirtualFolderCmd.label;"
-                         oncommand="gFolderTreeController.newVirtualFolder();"
-                         accesskey="&newVirtualFolderCmd.accesskey;"/>
+                        command="cmd_newVirtualFolder"
+                        accesskey="&newVirtualFolderCmd.accesskey;"/>
               <menuseparator id="newAccountPopupMenuSeparator"/>
               <menuitem id="newCreateEmailAccountMenuItem"
                         label="&newCreateEmailAccountCmd.label;"
                         accesskey="&newCreateEmailAccountCmd.accesskey;"
                         oncommand="NewMailAccountProvisioner(msgWindow);"/>
               <menuitem id="newMailAccountMenuItem"
                         label="&newExistingEmailAccountCmd.label;"
                         accesskey="&newExistingEmailAccountCmd.accesskey;"
@@ -2187,17 +2193,17 @@
                         label="&newOtherAccountsCmd.label;"
                         accesskey="&newOtherAccountsCmd.accesskey;"
                         oncommand="MsgAccountWizard();"/>
               <menuseparator id="newPopupMenuSeparator"/>
               <menuitem id="menu_newCard"/>
               <menuitem id="newIMContactMenuItem"
                         label="&newIMContactCmd.label;"
                         accesskey="&newIMContactCmd.accesskey;"
-                        oncommand="chatHandler.addBuddy();"/>
+                        command="cmd_addChatBuddy"/>
             </menupopup>
           </menu>
           <menuitem id="openMessageFileMenuitem" label="&openMessageFileCmd.label;"
             accesskey="&openMessageFileCmd.accesskey;"
             oncommand="MsgOpenFromFile();"/>
           <menuitem id="menu_close"/>
           <menuseparator id="fileMenuAfterCloseSeparator"/>
           <menu id="menu_saveAs" label="&saveAsMenu.label;" accesskey="&saveAsMenu.accesskey;">
@@ -2617,17 +2623,17 @@
           <menuitem id="menu_goChat" label="&goChatCmd.label;"
                     accesskey="&goChatCmd.accesskey;"
                     command="cmd_chat"
                     key="key_goChat"/>
           <menuseparator id="goChatSeparator"/>
           <menu id="goFolderMenu"
                 label="&folderMenu.label;"
                 accesskey="&folderMenu.accesskey;"
-                oncommand="gFolderTreeView.selectFolder(event.target._folder, true)">
+                command="cmd_goFolder">
             <menupopup id="menu_GoFolderPopup"
                        type="folder"
                        showFileHereLabel="true"
                        showRecent="true"
                        recentLabel="&contextMoveCopyMsgRecentMenu.label;"
                        recentAccessKey="&contextMoveCopyMsgRecentMenu.accesskey;"/>
           </menu>
           <menuseparator id="goFolderSeparator"/>
@@ -2863,30 +2869,30 @@
                   oncommand="openSavedFilesWnd();"/>
         <menuitem id="addonsManager" label="&addons.label;" accesskey="&addons.accesskey;"
                   oncommand="openAddonsMgr();"/>
         <menuitem id="activityManager" label="&activitymanager.label;"
                   accesskey="&activitymanager.accesskey;"
                   oncommand="openActivityMgr();"/>
         <menu id="imAccountsStatus" label="&imAccountsStatus.label;"
               accesskey="&imAccountsStatus.accesskey;"
-              oncommand="chatHandler.setStatusMenupopupCommand(event);">
+              command="cmd_chatStatus">
           <menupopup id="imStatusMenupopup">
             <menuitem id="imStatusAvailable" status="available" label="&imStatus.available;" class="menuitem-iconic"/>
             <menuitem id="imStatusUnavailable" status="unavailable" label="&imStatus.unavailable;" class="menuitem-iconic"/>
             <menuseparator id="imStatusOfflineSeparator"/>
             <menuitem id="imStatusOffline" status="offline" label="&imStatus.offline;" class="menuitem-iconic"/>
             <menuseparator id="imStatusShowAccountsSeparator"/>
             <menuitem id="imStatusShowAccounts" label="&imStatus.showAccounts;"/>
           </menupopup>
         </menu>
         <menuitem id="joinChatMenuItem"
                   label="&joinChatCmd.label;"
                   accesskey="&joinChatCmd.accesskey;"
-                  oncommand="chatHandler.joinChat();"/>
+                  command="cmd_joinChat"/>
 
         <menuseparator id="devToolsSeparator"/>
         <menuitem id="filtersCmd" label="&filtersCmd2.label;"
                   accesskey="&filtersCmd2.accesskey;"
                   command="cmd_displayMsgFilters"/>
         <menuitem id="applyFilters"
                   label="&filtersApply.label;"
                   accesskey="&filtersApply.accesskey;"
--- a/mail/base/content/messageWindow.js
+++ b/mail/base/content/messageWindow.js
@@ -526,16 +526,18 @@ function ShowMenus()
     openMail3Pane_menuitem.removeAttribute("hidden");
   openMail3Pane_menuitem = document.getElementById('appmenu_tasksMenuMail');
   if (openMail3Pane_menuitem)
     openMail3Pane_menuitem.removeAttribute("hidden");
 }
 
 function HideMenus()
 {
+  // TODO: Seems to be a lot of repetitive code.
+  // Can we just fold this into an array of element IDs and loop over them?
   var message_menuitem=document.getElementById('menu_showMessage');
   if (message_menuitem)
     message_menuitem.setAttribute("hidden", "true");
 
   message_menuitem = document.getElementById('appmenu_showMessage');
   if (message_menuitem)
     message_menuitem.setAttribute("hidden", "true");
 
@@ -715,16 +717,32 @@ function HideMenus()
   let goRecentlyClosedTabsSeparator = document.getElementById('goRecentlyClosedTabsSeparator');
   if (goRecentlyClosedTabsSeparator)
     goRecentlyClosedTabsSeparator.setAttribute("hidden", "true");
 
   goRecentlyClosedTabsSeparator = document.getElementById('appmenu_goRecentlyClosedTabsSeparator');
   if (goRecentlyClosedTabsSeparator)
     goRecentlyClosedTabsSeparator.setAttribute("hidden", "true");
 
+  let goFolder = document.getElementById('goFolderMenu');
+  if (goFolder)
+    goFolder.hidden = true;
+
+  goFolder = document.getElementById('appmenu_goFolderMenu');
+  if (goFolder)
+    goFolder.hidden = true;
+
+  goFolder = document.getElementById("goFolderSeparator");
+  if (goFolder)
+    goFolder.hidden = true;
+
+  goFolder = document.getElementById("appmenu_goFolderSeparator");
+  if (goFolder)
+    goFolder.hidden = true;
+
   var goStartPage = document.getElementById('goStartPage');
   if (goStartPage)
    goStartPage.hidden = true;
 
   goStartPage = document.getElementById('appmenu_goStartPage');
   if (goStartPage)
    goStartPage.hidden = true;
 
@@ -1048,24 +1066,25 @@ var MessageWindowController =
         return true;
       default:
         return false;
     }
   },
 
   doCommand: function(command)
   {
-    // if the user invoked a key short cut then it is possible that we got here for a command which is
-    // really disabled. kick out if the command should be disabled.
-    if (!this.isCommandEnabled(command)) return;
+    // If the user invoked a key short cut then it is possible that we got here
+    // for a command which is really disabled. Kick out if the command should be disabled.
+    if (!this.isCommandEnabled(command))
+      return;
 
     var navigationType = nsMsgNavigationType.nextUnreadMessage;
 
-  switch ( command )
-  {
+    switch (command)
+    {
     case "cmd_getNewMessages":
       MsgGetMessage();
       break;
         case "cmd_undo":
             messenger.undo(msgWindow);
             break;
         case "cmd_redo":
             messenger.redo(msgWindow);
@@ -1259,17 +1278,17 @@ var MessageWindowController =
         break;
       case "button_previousMsg":
       case "cmd_previousMsg":
         performNavigation(nsMsgNavigationType.previousMessage);
         break;
       case "button_previous":
       case "cmd_previousUnreadMsg":
         performNavigation(nsMsgNavigationType.previousUnreadMessage);
-    break;
+        break;
       case "cmd_previousFlaggedMsg":
         performNavigation(nsMsgNavigationType.previousFlagged);
         break;
       case "cmd_goForward":
         performNavigation(nsMsgNavigationType.forward);
         break;
       case "cmd_goBack":
         performNavigation(nsMsgNavigationType.back);