mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-07 09:13:12 +00:00
Fix bug 82139; ensure that Find-related items get disabled when in view source mode. r=brade, sr=kin
This commit is contained in:
parent
ce7d569925
commit
e0bfe4c093
@ -570,7 +570,7 @@ var nsFindCommand =
|
||||
{
|
||||
isCommandEnabled: function(aCommand, dummy)
|
||||
{
|
||||
return (window.editorShell != null);
|
||||
return (window.editorShell && !IsInHTMLSourceMode());
|
||||
},
|
||||
|
||||
doCommand: function(aCommand)
|
||||
@ -586,7 +586,7 @@ var nsFindNextCommand =
|
||||
{
|
||||
// we can only do this if the search pattern is non-empty. Not sure how
|
||||
// to get that from here
|
||||
return (window.editorShell != null);
|
||||
return (window.editorShell && !IsInHTMLSourceMode());
|
||||
},
|
||||
|
||||
doCommand: function(aCommand)
|
||||
@ -600,7 +600,7 @@ var nsReplaceCommand =
|
||||
{
|
||||
isCommandEnabled: function(aCommand, dummy)
|
||||
{
|
||||
return (window.editorShell != null);
|
||||
return (window.editorShell && !IsInHTMLSourceMode());
|
||||
},
|
||||
|
||||
doCommand: function(aCommand)
|
||||
@ -614,7 +614,7 @@ var nsSpellingCommand =
|
||||
{
|
||||
isCommandEnabled: function(aCommand, dummy)
|
||||
{
|
||||
return (window.editorShell != null) && IsSpellCheckerInstalled();
|
||||
return (window.editorShell != null) && !IsInHTMLSourceMode() && IsSpellCheckerInstalled();
|
||||
},
|
||||
|
||||
doCommand: function(aCommand)
|
||||
|
@ -114,12 +114,18 @@ function IsEditorContentHTML()
|
||||
return (editorShell.contentsMIMEType == "text/html");
|
||||
}
|
||||
|
||||
function IsInHTMLSourceMode()
|
||||
{
|
||||
return (gEditorDisplayMode == DisplayModeSource);
|
||||
}
|
||||
|
||||
// are we editing HTML (i.e. neither in HTML source mode, nor editing a text file)
|
||||
function IsEditingRenderedHTML()
|
||||
{
|
||||
return IsEditorContentHTML() && (gEditorDisplayMode != DisplayModeSource);
|
||||
return IsEditorContentHTML() && !IsInHTMLSourceMode();
|
||||
}
|
||||
|
||||
|
||||
// This is called when the real editor document is created,
|
||||
// before it's loaded.
|
||||
var DocumentStateListener =
|
||||
|
@ -140,7 +140,7 @@
|
||||
<!-- edit menu commands. These get updated by code in globalOverlay.js -->
|
||||
<commandset id="composerEditMenuItems"
|
||||
commandupdater="true"
|
||||
events="create"
|
||||
events="create, mode_switch"
|
||||
oncommandupdate="goUpdateComposerMenuItems(this)"
|
||||
>
|
||||
<command id="cmd_undo"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user