mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-23 22:13:34 +00:00
Don't show the diff-mode selector if not viewing a diff
The DifferenceEngineBeforeDiffTable hook is run when viewing a diff after switching from visual to source editing, but the mode selection widget shouldn't be shown then. Bug: T324759 Change-Id: Ieb8a1b77928201a45635af46635b902cac01a36d
This commit is contained in:
parent
285a5399e4
commit
00abad4861
|
@ -148,7 +148,10 @@ class Hooks implements DifferenceEngineBeforeDiffTableHook {
|
|||
->makeConfig( 'visualeditor' );
|
||||
$output = RequestContext::getMain()->getOutput();
|
||||
|
||||
if ( !ApiVisualEditor::isAllowedContentType( $veConfig, $diff->getTitle()->getContentModel() ) ) {
|
||||
// Return early if not viewing a diff of an allowed type.
|
||||
if ( !ApiVisualEditor::isAllowedContentType( $veConfig, $diff->getTitle()->getContentModel() )
|
||||
|| $output->getActionName() !== 'view'
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue